Page 1 of 1

error receiving backslash in form data

Posted: Fri Feb 29, 2008 3:27 am
by ritwick
Hi,
I have simple module for submitting a form data and printing it.
The problem is, if there is any occurrence of backslash in the form data, it is doubled! i.e. there are two backslashes instead of one in the received data.
I've tried inserting set_magic_quotes_runtime = 0; , but still have the problem.
Thanks in advance.

- Ritwick

The form source:

<form name="seldir" id="seldir" action="./add_pages.php" method="post">
<input type="hidden" name="parent_dir" id="parent_dir" value="\admin">
</form>
The PHP value catching code in (add_pages.php) :
print 'PARENT: '.($_POST['parent_dir']).'<br>';
The PHP output:
PARENT: \\admin

Re: error receiving backslash in form data

Posted: Fri Feb 29, 2008 10:07 am
by Christopher
Use stripslashes().