Page 1 of 1
Getting rid of Slashes \
Posted: Wed Oct 08, 2003 6:49 am
by itspram
Hi Experts all...
As per testing rules I need to use
1"\45|!,')0 1"\45|!,')0 1"\45|!,')0 1"\45|!,')(50)
as an input value. it inserts properly in mysql.
but when I try to edit it it shows me "\\" instead of "\"
and If I refresh the pages it mupltiplies....
Please suggest what to do....
stripslashes isnt work for me coz. I need to insert slashes in the database..
thanks in advance
Posted: Wed Oct 08, 2003 6:52 am
by qads
Code: Select all
$block_of_text = stripslashes($block_of_text);

..check it out at php.net for more information..
Posted: Wed Oct 08, 2003 6:52 am
by AVATAr
dont us strip_slashes before you insert in the DB.. use stripslashes when you output the fields for editing (when you echo those in the form fields).
Posted: Wed Oct 08, 2003 6:53 am
by qads
dam that was fast avatar lol
Posted: Wed Oct 08, 2003 6:54 am
by AVATAr
YEAHHH!!!!
Posted: Wed Oct 08, 2003 7:06 am
by itspram
thanks Guys,
but problem is not yet solved.
if I will output with stripslash it will remove all slashes originally I have.
I need them in my table as it is.
and if I will use addslashes on update it will again multiply slashes to orginals ...
any other options ?
Posted: Wed Oct 08, 2003 7:19 am
by evilMind
might try using stripcslashes() but that'll probably have the same results that stripslashes has... or you could reg em' out.
ereg_replace('\','',$removeSlashesString);
-or-
ereg_replace("\\",'',$removeSlashesString);
Posted: Wed Oct 08, 2003 1:21 pm
by McGruff
Posted: Thu Oct 09, 2003 1:27 am
by itspram
Thanks all of you...
you all are great people here...
A special thanks to McGruff, a Moderator..
issue resolved....
hope will come up with new issue for all of you...
Prams