Page 1 of 1

parse error, unexpected T_STRING in /contact.php on line 4

Posted: Thu Jan 22, 2009 4:18 pm
by highdemanddesign
parse error, unexpected T_STRING in /contact.php on line 4

I have a contact form on a yahoo website that I can't get to work. I'm unexperienced with PHP and have some experience with html. Here is the code from the contact.php

<?
$subject="from ".$_GET['your_name'];
$headers= "From: "info@focusadmin.com"; ----this is line 4---
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("angie@focusadmin.com", $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>

<br>
".$_GET['message']."<br>
".$_GET['your_name']."<br>
".$_GET['your_phone']."<br>
".$_GET['your_address']."<br>
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300)
//window.close()
</script>

Re: parse error, unexpected T_STRING in /contact.php on line 4

Posted: Thu Jan 22, 2009 5:16 pm
by requinix
And here's what you see when you use an editor with syntax highlighting:

Code: Select all

<?
$subject="from ".$_GET['your_name'];
$headers= "From: "info@focusadmin.com";
$headers.='Content-type: text/html; charset=iso-8859-1';
 
Oops. Looks like those quotes are causing a problem.

Re: parse error, unexpected T_STRING in /contact.php on line 4

Posted: Thu Jan 22, 2009 5:16 pm
by Reviresco

Code: Select all

$headers= "From: info@focusadmin.com";

Re: parse error, unexpected T_STRING in /contact.php on line 4

Posted: Thu Jan 22, 2009 8:30 pm
by highdemanddesign
Thanks so much. That helped, I no longer get the error. It says my message was sent successfully. But now I never get the message. Not really sure what to do from here...