It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

addslashes- stripslashes problem

Moderator: Malcolm

addslashes- stripslashes problem

Postby john_zakaria on Wed Jan 11, 2012 8:27 am

i have a form for exam where the user can enter data in text field with any special character (quote ('), double quote ("), backslash (\))

so i use addslashes in post then i echo the field using stripslashes and everything till this point is OK.

my problem is that the answer may contains a slash in the text field e.g: jo\hn
but when i tried to echo it using stripslashes it echos "john" which is wrong.

i used addslashes and addcslashes to try fix this error but it still exists

i want to add slashes to all special character except the backslashes "'\" .. so the answer to be as it is "jo\hn"

any idea
john_zakaria
50+ Club
 
Posts: 60
Joined: Sun Feb 08, 2009 7:29 am

Who is online

Users browsing this forum: No registered users and 0 guests