steelerman99 Posted March 13, 2009 Share Posted March 13, 2009 Hello! I recently ran into a bit of a problem and I'm not sure how to handle it. I was putting in some test data the other day, and in one of the boxes I wrote "Apartment #234", and my input to my php page got all messed up (truncated) since it treated the # like a hash and didn't convert the # to a %23. Likewise if I enter Steve & Mary, "Mary" is treated like i'm passing a variable named Mary. How do you deal with special characters like #, %, &, etc. that a user inputs to a form and is sent via an ajax url? Is there a better way to handle it than to do a string replace of every non-alphanumeric character imaginable? Thanks! Link to comment https://forums.phpfreaks.com/topic/149203-dealing-with-odd-characters-in-input-etc/ Share on other sites More sharing options...
The Little Guy Posted March 13, 2009 Share Posted March 13, 2009 Escape: http://www.w3schools.com/jsref/jsref_escape.asp Link to comment https://forums.phpfreaks.com/topic/149203-dealing-with-odd-characters-in-input-etc/#findComment-783541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.