You are here: Re: [PHP] Register Globals « PHP « IT news, forums, messages
Re: [PHP] Register Globals

Posted by tg-php on 11/05/05 04:37

I'm guessing it's because of the double quotes within double quotes in the "From" part:

mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"],
60), "From: $_POST["from"]\r\n");

Your $_POST["subject"] is ok because that's all that's in that part of the parameter, but the part:

"From: $_POST["from"]\r\n"

...is going to cause problems because the "from" double quotes interfere with the outside double quotes.

Try changing it to:

"From: $_POST['from']\r\n"

...with single quotes on the 'from' or put the $_POST variable outside the quotes:

"From: " . $_POST["from"] . "\r\n"

Hope that helps!

-TG



= = = Original message = = =

Ok, you are all used to working with register_gloabsl=off.

mail($to, stripslashes($subject), wordwrap($message, 60), "From:
$from\r\n");

I change this line to:

mail($to, stripslashes($_POST["subject"]), wordwrap($_POST["message"],
60), "From: $_POST["from"]\r\n");

and I get:
Parse error: parse error, unexpected '\"', expecting T_STRING or
T_VARIABLE or T_NUM_STRING in /www-html/emailer/index.html on line 41

What is the problem?
John

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация