Jump to content

Archived

This topic is now archived and is closed to further replies.

rshadarack

Backslashes

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
I'd recomend just using

[code]html_entities($_POST['FORM'], ENT_QUOTES);[/code]
That way all the HTML entered would become "safe"...'er'

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.