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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
highdemanddesign
Forum Newbie
Posts: 4
Joined: Thu Jan 22, 2009 4:15 pm

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

Post 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>
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

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

Post 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.
Reviresco
Forum Contributor
Posts: 172
Joined: Tue Feb 19, 2008 4:18 pm
Location: Milwaukee

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

Post by Reviresco »

Code: Select all

$headers= "From: info@focusadmin.com";
highdemanddesign
Forum Newbie
Posts: 4
Joined: Thu Jan 22, 2009 4:15 pm

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

Post 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...
Post Reply