| Posted by Trammel on 07/28/07 02:11 
Im accepting user input from a text-box on a webpage.I am then wanting to echo that back into the same box when the page is
 submitted.
 
 The problem I have is that the input COULD contain multiple quotes and
 double-quotes.
 AddSlashes doesnt seem to work properly, as it turns ' into \'
 ....and " just into \ (removing everything after)
 
 I thought of using single-quotes for the Value='' and then use preg_replace
 to replace all occurances of ' with \'  ...but I cant figure-out how to do
 it.
 
 Anyone got any idea?
 
 
 
 For example the user might have entered:  ''''"""'"'"''"' (A collection of
 quotes & double-quotes)
 The input is stored in $myVar... and needs to be put BACK inside Value=''
 [Back to original message] |