Mail form problemer
Hej derude.Er der nogen der kan svare mig på hvorfor det ikke virker?
Jeg får denne fejl;
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in on line 52
Min kode ser sådan ud; [en smule lang] Håber i vil hjælpe, vil nemlig gerne have den til at virke! Tusind tak!
<html>
<head>
<?php
// your name
$recipientname = "Snakelord Stewart";
// your email
$recipientemail = "hartmann@9kilo.dk";
// subject of the email sent to you
$subject = "Oscar vote by $recipientname";
// send an autoresponse to the user?
$autoresponse = "no";
// subject of autoresponse
$autosubject = "Thank you for your vote!";
// autoresponse message
$automessage = "This is an auto response to let you know that we've successfully received your vote sent through our form. Thanks! We'll get back to you shortly.";
// thankyou displayed after the user clicks "submit"
$thanks = "Thank you for your vote.<br>We will get back to you as soon as possible.<br>";
// END OF NECESSARY MODIFICATIONS
?>
<style type="text/css"><!--
td,body,input,textarea {
font-size:12px;
font-family:Verdana,Arial,Helvetica,sans-serif;
color:#000000}
--></style>
</head>
<body>
<table width="100%" height="100%"><tr>
<td valign="top"><font face="Verdana,Arial,Helvetica" size="2">
<?php
if($_POST['submitform']) {
$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
$subject = $HTTP_POST_VARS['subject'];
$1 = $HTTP_POST_VARS['1'];
$2 = $HTTP_POST_VARS['2'];
$3 = $HTTP_POST_VARS['3'];
$4 = $HTTP_POST_VARS['4'];
$5 = $HTTP_POST_VARS['5'];
$6 = $HTTP_POST_VARS['6'];
$7 = $HTTP_POST_VARS['7'];
$8 = $HTTP_POST_VARS['8'];
$9 = $HTTP_POST_VARS['9'];
$10 = $HTTP_POST_VARS['10'];
$11 = $HTTP_POST_VARS['11'];
$12 = $HTTP_POST_VARS['12'];
$13 = $HTTP_POST_VARS['13'];
$14 = $HTTP_POST_VARS['14'];
$15 = $HTTP_POST_VARS['15'];
$16 = $HTTP_POST_VARS['16'];
$17 = $HTTP_POST_VARS['17'];
$18 = $HTTP_POST_VARS['18'];
$19 = $HTTP_POST_VARS['19'];
$20 = $HTTP_POST_VARS['20'];
$21 = $HTTP_POST_VARS['21'];
$22 = $HTTP_POST_VARS['22'];
$23 = $HTTP_POST_VARS['23'];
$24 = $HTTP_POST_VARS['24'];
$25 = $HTTP_POST_VARS['25'];
$26 = $HTTP_POST_VARS['26'];
$27 = $HTTP_POST_VARS['27'];
$28 = $HTTP_POST_VARS['28'];
$29 = $HTTP_POST_VARS['29'];
$30 = $HTTP_POST_VARS['30'];
$31 = $HTTP_POST_VARS['31'];
// check required fields
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "Missing $dcheck[$check]<br>";
}
}
// check email address
if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $Email))){
$error .= "Invalid email address<br>";}
// display errors
if($error) {
?>
<b>Error</b><br>
<?php echo $error; ?><br>
<a href="#" onClick="history.go(-1)">try again</a>
<?php
}
else
{
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;
// format message
$message = "Vote for Oscar by $recipientname:
Ingame Name: $name
Email: $email
Comments: $Comments
Answer on question 1: $1
Answer on question 2: $2
Answer on question 3: $3
Answer on question 4: $4
Answer on question 5: $5
Answer on question 6: $6
Answer on question 7: $7
Answer on question 8: $8
Answer on question 9: $9
Answer on question 10: $10
Answer on question 11: $11
Answer on question 12: $12
Answer on question 13: $13
Answer on question 14: $14
Answer on question 15: $15
Answer on question 16: $16
Answer on question 17: $17
Answer on question 18: $18
Answer on question 19: $19
Answer on question 20: $20
Answer on question 21: $21
Answer on question 22: $22
Answer on question 23: $23
Answer on question 24: $24
Answer on question 25: $25
Answer on question 26: $26
Answer on question 27: $27
Answer on question 28: $28
Answer on question 29: $29
Answer on question 30: $30
Answer on question 31: $31
-----------------------------
Browser: $browser
User IP: $ip";
// send mail and print success message
mail($recipientemail,"$subject","$message","From: $Name <$Email>");
if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$automessage = stripslashes($automessage);
mail($Email,"$autosubject","$automessage","From: $recipientname <$recipientemail>");
}
echo "$thanks";
}
}
else {
?>
<form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="require" value="name,email,subject,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31">
<center>
<b>Voting for "Oscar 2004/2005"</b>
<p>
<b><font color="red">All fields need to be filled!</font></b><p>
<b>Ingame Name:</b> <br> <input id="t1" type="text" name="name"><br />
<b>E-mail:</b> <br><input id="t2" type="text" name="email"><br />
<b>Subject:</b> <br><input id="t3" type="text" name="subject" value="Oscar Vote 2004/2005" disabled><br /> <br> <br> <br>
<b>1)</b> Which merchant do you buy from the most? <br><input id="t4" type="text" name="1" /><br />
<b>2)</b> Which merchant offers the best value for money? <br> <input id="t5" type="text" name="2" /><br />
<b>3)</b> Which merchant sells the best items? <br> <input id="t100" type="text" name="3" /><br />
<b>4)</b> Who is the best all round merchant? <br> <input id="t7" type="text" name="4" /><br />
<b>5)</b> Who is the shard's most untrustworthy merchant? <br> <input id="t8" type="text" name="5" /><br />
<b>6)</b> Which is the best warrior guild? <br> <input id="t9" type="text" name="6" /><br />
<b>7)</b> Which is the best merchant guild? <br> <input id="t10" type="text" name="7" /><br />
<b>8)</b> Which is the n00biest guild? <br> <input id="t11" type="text" name="8" /><br />
<b>9)</b> Which guild are most disliked? <br> <input id="t12" type="text" name="9" /><br />
<b>10)</b> Which guild are the biggest gankers? <br> <input id="t13" type="text" name="10" /><br />
<b>11)</b> Who is the all round best player? <br> <input id="t14" type="text" name="11" /><br />
<b>12)</b> Who is the shards biggest houserunner/townrunner? <br> <input id="t15" type="text" name="12" /><br />
<b>13)</b> Who is the shards biggest loser? <br> <input id="t16" type="text" name="13" /><br />
<b>14)</b> Who is the shards friendliest/nicest player? <br> <input id="t17" type="text" name="14" /><br />
<b>15)</b> Who is the shards best mage pvper? <br><input id="t18" type="text" name="15" /><br />
<b>16)</b> Who is the shards best warrior pvper? <br><input id="t19" type="text" name="16" /><br />
<b>17)</b> Who is the shards all round best pvper? <br><input id="t20" type="text" name="17" /><br />
<b>18)</b> Who is the shards biggest looter? <br><input id="t21" type="text" name="18" /><br />
<b>19)</b> Who is the shards most annoying thief? <br><input id="t22" type="text" name="19" /><br />
<b>20)</b> Who is the shards biggest scammer? <br><input id="t23" type="text" name="20" /><br />
<b>21)</b> If you could kick, ban, wipe one player, who would it be? <br><input id="t24" type="text" name="21" /><br />
<b>22)</b> What is the shard's best player run business? <i>(i.e bar/casino/restaurant) (Name the establishment you like/visit by name such as Rigmoros restaurant etc)</i> <br> <input id="t25" type="text" name="22" /><br />
<b>23)</b> What is the shards best town? <br> <input id="t26" type="text" name="23" /><br />
<b>24)</b> What is the shards best type of tourney? <br><input id="t27" type="text" name="24" /><br />
<b>25)</b> If you could meet any player in real life, who would it be? <br><input id="t28" type="text" name="25" /><br />
<b>26)</b> Which country has the best collection of players on the shard? <br> <input id="t29" type="text" name="26" /><br />
<b>27)</b> Who has the shards most nicely decorated house? <br><input id="t30" type="text" name="27" /><br />
<b>28)</b> What item are you after more than anything else? <br><input id="t31" type="text" name="28" /><br />
<b>29)</b> What monster is the most worth killing? <br> <input id="t32" type="text" name="29" /><br />
<b>30)</b> What is the best pvm location? <br> <input id="t33" type="text" name="30" /><br />
<b>31)</b> What is the best pvp location? <br> <input id="t34" type="text" name="31" /><br />
<input id="t6" type="submit" name="submitform" value=" Send my votes " />
<input type="reset" value=" Reset everything " />
</form>
<?php } ?>
</font><p></td>
</tr><tr>
</body>
</html>
