RE: [PHP] Why???
| From: | Maxim Maletsky | Date: | Fri, 16 Feb 2001 03:19:29 +0000 |
| Subject: | RE: [PHP] Why??? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40076@lists.php.net to get a copy of this message | ||
Sure,
here's the fix -- stripslashes() !
I'll explain : in PHP certain caracters have to be escaped to prevent these
hackers breaking your code up.
By default configuration PHP will automatically insert a backslash '/'
infront of every "dangerous" caracters received via GET, POST ect ... for
instance on a form submission.
In your code you should use the strings just as they are (in the way they
arrived to you), except that on output using stripslashes() the backslash
will disappear.
BUT REMEMBER - ONLY ON OUTPUT...
ie:
echo stripslashes($text);
Cheers,
Maxim Maletsky
-----Original Message-----
From: Nguyen, David M [mailto:david.m.nguyen@xo.com]
Sent: Thursday, February 15, 2001 1:03 AM
To: php-general@lists.php.net
Subject: [PHP] Why???
Hi all,
I have a PHP web form setup for user to fill in information then email it to
me after pressing SUBMIT button. Everytime user uses double-quote(") or
single(') it inserts (/) right in front of " or '. Does anyone know why and
how to fix it? Please advise. Below is example of what I got from my email
when user submits form to me.
Topic: Added \"Initial login to the EMS\" procedure.
Thanks in advance,
David
--
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