Hello Friends, I m getting a problem with my php program... <?php if(isset($_POST['submit'])) { $text = htmlspecialchars($_POST['text']); print $text; } print " <form method=post name=myform action=temp.php> <input type=text name=text> <input type=submit name=submit value=submit> </form> "; ?> this is very simple program... when i put ' or " to text box it returns \' and \"... although same program is working well with my local configuration. I m checking the things on PHP 2.5.8... Please i need a urgent solution for that...when i put ' and " to text box, it should return same thing to me ... not escape string.. Thanks
<?php if(isset($_POST['submit'])) { $text = strip_slashes( htmlspecialchars($_POST['text']) ); print $text; } print " <form method=post name=myform action=temp.php> <input type=text name=text> <input type=submit name=submit value=submit> </form> "; ?> PHP: That should work fine for you.
The other soultion is you can turn OFF php magic quotes using .htaccess file php_value magic_quotes_gpc off