Hi,
I have a problem... I am creating the frontend of a site where users can add their own content. My problem is that the registration process goes through about five screens.
I was just passing the variables from one screen to the next and storing them in a hidden form field. Then I noticed that at by the last screen (where I was inserting values into a database), and quotes (') had been escaped multiple times, once for each time they had been posted from one form to another. Fair enough, I wrote this recurisve version of stripslashes:
function stripAllSlashes($inputString){
while(substr_count($inputString, "\\"")>0 || substr_count($inputString, "\'")>0){
$inputString=stripAllSlashes(stripslashes($inputString));
}
return($inputString);
}
This seems to do the job (although any comments on increasing efficiency would be appreciated - would it be quicker with regular expressions?)....
BUT then I tried inputting a double quote (")... This messes everything up. Because even though it is escaped with a backslash, this is ignored in the line
<input type="hidden" name="author" value="lkj\"kjljj klj">
So the value of $author on the next page is just lkj\
Has anyone got any ideas on solutions to this?
tia,
Kelvin