RE: [PHP] HELP!! What wrong with this code...
| From: | Sam Masiello | Date: | Tue, 31 Jul 2001 16:17:30 +0000 |
| Subject: | RE: [PHP] HELP!! What wrong with this code... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60443@lists.php.net to get a copy of this message | ||
You need to put backslashes before your quotes in your echo statement. Like
this:
echo "<P align=center>Your feedback has been sent to <a
href=\"mailto:$address\">$name</a></P>";
HTH
Sam Masiello
Software Quality Assurance Engineer
Synacor
(716) 853-1362 x289
smasiello@synacor.com
-----Original Message-----
From: Steve Wright [mailto:steve@stevewrightonline.co.uk]
Sent: Tuesday, July 31, 2001 12:13 PM
To: PHP List
Subject: [PHP] HELP!! What wrong with this code...
Hey, i am getting an error passed back for this line of code, the rest of
the code is below:
echo "<P align=center>Your feedback has been sent to <a
href="mailto:$address">$name</a></P>";
the error is:
Parse error: parse error, expecting
','' or ';'' in
/www/customers/stevewrightonline.co.uk/form/do_sendform.php on line 20
Does anyone know y this is?? If i remove the a href tags it works fine. Can
you not use links properly in PHP??
------------------
<?php
$name = "Steven Wright";
$address ="auto_form@stevewrighjtonline.co.uk";
$recipient = $address;
$subject = "Auto Form";
$mailheaders = "From: Auto Form < $address > \n";
$mailheaders = "Reply-To: $sender_email\n\n";
/*The Message*/
$msg = "Sender:\t mailto:$sender_email \t
$sender_name\n\n";
$msg = "Message:\t$message\n\n";
/*Mail to Me*/
mail($recipient, $subject, $msg, $mailheaders);
/*Onscreen confirmation of sending*/
echo "<HTML><HEAD><TITLE>Form
Sent!</TITLE></HEAD><BODY>";
echo "<H1 align=center>Thank You, $sender_name</H1>";
echo "<P align=center>Your feedback has been sent to <a
href="mailto:$address">$name</a></P>";
echo "</BODY></HTML>";
?>