PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
itspram
Forum Newbie
Posts: 8 Joined: Tue Sep 16, 2003 6:26 am
Post
by itspram » Wed Oct 08, 2003 6:49 am
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
qads
DevNet Resident
Posts: 1199 Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane
Post
by qads » Wed Oct 08, 2003 6:52 am
Code: Select all
$block_of_text = stripslashes($block_of_text);
..check it out at php.net for more information..
AVATAr
Forum Regular
Posts: 524 Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:
Post
by AVATAr » Wed Oct 08, 2003 6:52 am
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).
qads
DevNet Resident
Posts: 1199 Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane
Post
by qads » Wed Oct 08, 2003 6:53 am
dam that was fast avatar lol
AVATAr
Forum Regular
Posts: 524 Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:
Post
by AVATAr » Wed Oct 08, 2003 6:54 am
YEAHHH!!!!
itspram
Forum Newbie
Posts: 8 Joined: Tue Sep 16, 2003 6:26 am
Post
by itspram » Wed Oct 08, 2003 7:06 am
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 ?
evilMind
Forum Contributor
Posts: 145 Joined: Fri Sep 19, 2003 10:09 am
Location: Earth
Post
by evilMind » Wed Oct 08, 2003 7:19 am
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);
McGruff
DevNet Master
Posts: 2893 Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland
Post
by McGruff » Wed Oct 08, 2003 1:21 pm
itspram
Forum Newbie
Posts: 8 Joined: Tue Sep 16, 2003 6:26 am
Post
by itspram » Thu Oct 09, 2003 1:27 am
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