PDA

View Full Version : Apostrophe Problem



dreamerp
April 8th, 2006, 09:30 AM
Hello,

I am passing information thru hidden fields after someone puts a value in. For example.

There is a textfield named "name". Let's say a person types, "Kirupa's Forum". Then, you press submit and there is a confirmation page that reviews the information. I used stripslashes on $name so when I echo it it shows it "Kirupa's Forum". But, in the hidden field it says "Kirupa". How can I change this?

Thanks,

Peter

dreamerp
April 8th, 2006, 09:35 AM
I have also tried htmlspecialchars and this didn't work for some reason.

OMG
April 8th, 2006, 11:11 AM
try " /' "

dreamerp
April 8th, 2006, 11:16 AM
Other people will be entering information, not me.

Ankou
April 8th, 2006, 01:46 PM
If you're striping slashes only to display the information but you still need to submit it again, just use the stripslashes() function when you show the name.

The other option would be to use stripslashes right when you get the data being passed and then use addslashes() when putting the information into the hidden value.