RE: [PHP] Re: HELP!! What wrong with this code...

From: Date: Tue, 31 Jul 2001 19:19:05 +0000
Subject: RE: [PHP] Re: HELP!! What wrong with this code...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60487@lists.php.net to get a copy of this message
Another solution that some may prefer is the here doc method: Instead of: php; code; here; ?> <P align=center>Your feedback has been sent to <a href="mailto:<?=$address?>"><?=$name?></a></P> <? php; code; here; you would have php; code; here; echo<<<EOF <P align=center>Your feedback has been sent to <a href="mailto:$address">$name</a></P> EOF; Php; code; here; That way you avoid the escaping of quotes, and the multiple flips in and out of php...its just the way I prefer... my $.02, jack -----Original Message----- From: scott [gts] [mailto:scott@graphictype.com] Sent: Tuesday, July 31, 2001 3:04 PM To: php Subject: RE: [PHP] Re: HELP!! What wrong with this code... or, if you're going to be dealing with a lot of data that has lots of quotes in it, you could take the safe route and just exit out of PHP mode lots of times, it's easier than escaping every single " php; code; here; ?> <P align=center>Your feedback has been sent to <a href="mailto:<?=$address?>"><?=$name?></a></P> <? php; code; here; > -----Original Message----- > From: Inércia Sensorial [mailto:inerte@hotmail.com] > Sent: Tuesday, July 31, 2001 12:25 PM > To: php-general@lists.php.net > Subject: [PHP] Re: HELP!! What wrong with this code... > > > Escape the double quotes inside the <a href> > > echo "<P align=center>Your feedback has been sent to <a > > href=\"mailto:$address\">$name</a></P>"; > > > -- > > Julio Nobrega. > > 2B||!BB - That's the question. > > "Steve Wright" <steve@stevewrightonline.co.uk> wrote in message > news:02c401c119db$b76a1700$0615fea9@COM... > 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 — > I¿z_С®ßÊÜp';'' 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>"; > ?> > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#60487) next »