rshadarack Posted September 10, 2006 Share Posted September 10, 2006 Is there a way for me to take backslashes from a form input, and replace it with \ (the html '\' code)? By the time I retrieve data using post, the backslashes are gone already. Link to comment https://forums.phpfreaks.com/topic/20259-backslashes/ Share on other sites More sharing options...
jefkin Posted September 10, 2006 Share Posted September 10, 2006 Hi, rshadarack,Sounds like a client side issue, so you could alway write some javascript to do it ... but ...the problem with replacing them in the client's html side is they're turned back into backslashes when it transfers to the server.Your real problem, as you can guess, is that once in the server side they can be stripped out depending on your PHP ini settings. I'm not much of a sys-admin type, but there are some others here that can probably point you in the right direction.Jeff Link to comment https://forums.phpfreaks.com/topic/20259-backslashes/#findComment-89167 Share on other sites More sharing options...
tleisher Posted September 10, 2006 Share Posted September 10, 2006 Couldn't he just use str_replace()?http://us3.php.net/manual/en/function.str-replace.php Link to comment https://forums.phpfreaks.com/topic/20259-backslashes/#findComment-89181 Share on other sites More sharing options...
jefkin Posted September 11, 2006 Share Posted September 11, 2006 You may be right tleisher, but without his code, I just guessed that he's having a problem retrieving the '\' on the php side. before he could get to it with a str_replace().Maybe I missunderstood. If so, appologies rshadarack.Otherwise, I'm thinking the problem is he's got magic_quotes or some such set to muddle with his form input strings.Like I said, could be wrong...Jeff Link to comment https://forums.phpfreaks.com/topic/20259-backslashes/#findComment-89575 Share on other sites More sharing options...
Nhoj Posted September 11, 2006 Share Posted September 11, 2006 I'd recomend just using[code]html_entities($_POST['FORM'], ENT_QUOTES);[/code]That way all the HTML entered would become "safe"...'er' Link to comment https://forums.phpfreaks.com/topic/20259-backslashes/#findComment-89582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.