PHP Problems...

  • Thread starter Thread starter Omero
  • 1 comments
  • 533 views
Messages
183
Hey people. I've been trying to create a php mailing function for my RPG and I've been having a little trouble with it. Whenever I load it up, this error message always shows up:

Parse error: parse error, unexpected T_STRING in .../joinformsubmit.php on line 17

Now, here's my PHP file:

PHP:
<?php
@extract($_post);
$subject = "\"Another Person Joined!\"";
$charactername = stripslashes($charactername);
$AIM = stripslashes($AIM);
$email = stripslashes($email);
$strength = stripslashes($strength);
$defense = stripslashes($defense);
$speed = stripslashes($speed);
$ki = stripslashes($ki);
$move1 = stripslashes($move1);
$move2 = stripslashes($move2);
$move3 = stripslashes($move3);
$race = stripslashes($race);
$otherrace = stripslashes($otherrace);
$txt = "\"Character Name: \",$charactername,\"<br>\",\"AIM: \",$AIM,\"<br>\",\"Email: \",$email,\"<br>\",\"Strength: \",$strength,\"<br>\",\"Defense: \",$defense,\"<br>\",\"Speed: \",$speed,\"<br>\",\"Ki: \",$ki,\"<br>\",\"First Move: \",$move1,\"<br>\",\"Second Move: \",$move2,\"<br>\",\"Third Move: \",$move3,\"<br>\",\"Race: \",$race,\"<br>\",\"Other Race: \",$otherrace,\"<br>\""
mail('Jpec07@charter.net',$subject,$txt);
header("location:confirm.html");
?>

Now, can you guys tell me what's happening and how I go about fixing it? Thanks.
 
$txt = "Character Name: " . $charactername ."<br>" "AIM:" . $AIM . "<br>Email: " . $email . "<br>Strength: " .$strength . "<br>Defense: " . $defense" . <br>Speed: " . $speed . "<br>Ki: " . $ki . "<br>First Move: " . $move1 . "<br>Second Move: " . $move2 . "<br>Third Move: " . $move3 . "<br>Race: " . $race . "<br>Other Race: " . $otherrace ."<br>";


Thats whats wrong with line 17. You need to concatonate(sp?) HTML and php variables using a period. By HTML I mean the tags AND the the text. Using \ to escape the quote will just end up confusing you in the end. This should be in the programming section by the way :)

PS: Im at work so I can't compile that, but I hope you get the idea.
 
Back