June 17th, 2000, 12:56 AM
Say you have a form with a textarea. Say you type something with single-quotes (e.g. I'm happy so I'm sad) in the textarea. When the textarea is POSTed to a PHP program, are they escaped with the backslash?
I ran it on two different servers and one did and one didn't. Why is this? Is there some setting somewhere? Or is this a version diff thing?
Here is the PHP code (I changed all angle brackets to square ones so it'll appear):
[textarea name="sometext" wrap="virtual" cols=55 rows=4][/textarea]
[input type="submit" value="Save"]
echo "Just received: $sometext -- are the single quotes escaped?[p]";
Thanks for any help!
June 17th, 2000, 01:02 AM
put $sometext in a stripslashes() function. eg;
<?php printf("Just received: %s -- are the single quotes escaped?",stripslashes($sometext));?>
To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson
June 17th, 2000, 04:35 AM
One of the servers probably had magic quotes switched on while the other didn't.