hoangthi Posted June 8, 2012 Share Posted June 8, 2012 Here is my basic example: <? echo $result = $_POST["test"]; ?> <form method="post" action="<?php echo $PHP_SELF;?>"> <b>TEST: </b> </br> <textarea rows="2" name="test" cols="60"></textarea><br /> <input type="submit" value="submit" name="submit"> </form> Input abcdefg into textarea and click Submit, and we will see $result = abcdefg; But if i type: /<title>(.*)<\/title>/isU We will have $result = /<title>(.*)<\\/title>/isU (NOT /<title>(.*)<\/title>/isU ) I want to get $result = /<title>(.*)<\/title>/isU Please help me. Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/ Share on other sites More sharing options...
scootstah Posted June 8, 2012 Share Posted June 8, 2012 You probably have magic quotes turned on. Turn it off in the php.ini. Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/#findComment-1352205 Share on other sites More sharing options...
hoangthi Posted June 8, 2012 Author Share Posted June 8, 2012 Easy to do, just create a php.ini with some commands and upload it, but can you help me with an other way? Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/#findComment-1352222 Share on other sites More sharing options...
scootstah Posted June 8, 2012 Share Posted June 8, 2012 You can try stripslashes. Or don't use slashes as the delimiter and then you don't have to escape them. But all you have to do is change a "1" to a "0" and the problem goes away. Don't make it harder than it has to be. Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/#findComment-1352225 Share on other sites More sharing options...
hoangthi Posted June 9, 2012 Author Share Posted June 9, 2012 i want to make a form to input tags for preg match all so i nEed initial value of the form... Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/#findComment-1352378 Share on other sites More sharing options...
hoangthi Posted June 9, 2012 Author Share Posted June 9, 2012 Thank you so much, Simply, add to .htacess this: php_flag magic_quotes_gpc Off Quote Link to comment https://forums.phpfreaks.com/topic/263862-how-to-get-html-entities-from-_post/#findComment-1352422 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.