Forums

PHP

This topic is locked

unexpected T_STRING Help!

Posted 17 Feb 2008 22:32:31
1
has voted
17 Feb 2008 22:32:31 bobby boo posted:
Hello. I am trying to make this form to echo the input text on a next page. When I fill in the form and click submit I get
"Parse error: syntax error, unexpected T_STRING in /home/erie0d2d/public_html/flightplantest/sendeail.php on line 13"
Can anybody please help me. I'm new to PHP.

THanks for your time,


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$Callsign = $_POST['Callsign'];
(LINE 13)$Aircraft Type = $_POST['Aircraft Type'];
$IFR VFR = $_POST['IFR VFR'];
$Departure Point = $_POST['Departure Point'];
$Arrival Point = $_POST['Arrival Point'];
$Route of Flight = $_POST['Route of Flight'];
$Altitude (Flight Level) = $_POST['Altitude (Flight Level)'];
if (eregi('http:', $notes)) {
die ("Do NOT try that! ! ";
}
if(!$visitormail == "" && (!strstr($visitormail,"@" || !strstr($visitormail,"."))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ";
}
if(empty($Callsign) || empty($Aircraft Type) || empty($IFR VFR || empty($Departure Point || empty($Arrival Point || empty($Route of Flight || empty($Route of Flight || empty($Altitude)) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ";
}
$todayis = date("l, F j, Y, g:i a" ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("YourEmail", $subject, $message, $from);
?>
<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>
<br /><br />
<a href="contact.php"> Next Page </a>
</p>
</body>
&lt;/html&gt;<b></b><b></b>

Replies

Replied 18 Feb 2008 14:57:36
18 Feb 2008 14:57:36 Alan C replied:
hi

you have a space in that line, so the interpreter see $aircraft as the variable, then there is a space so it thinks Type is another variable and bombs out

try putting an underscore so it's $Aircraft_Type

that should work fine <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Replied 18 Feb 2008 16:51:49
18 Feb 2008 16:51:49 bobby boo replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
hi

you have a space in that line, so the interpreter see $aircraft as the variable, then there is a space so it thinks Type is another variable and bombs out

try putting an underscore so it's $Aircraft_Type

that should work fine <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>


Thanks a bunch. It works like a charm...!

Reply to this topic