bluebutterflyofyourmind Posted July 17, 2008 Share Posted July 17, 2008 Hey there so i'm trying to pass a body of text through ajax to my php script. the issue is that if they put in an & or sometimes quotes, the text gets messed up. the quotes are just an html thing i guess. but the & cause the AJAX line passing the variable to the php to think that everything after is now a new variable. is there a way to pass text, and have it isolated so that it doesn't affect the javascript? thanks! Quote Link to comment Share on other sites More sharing options...
corbin Posted July 18, 2008 Share Posted July 18, 2008 Either use encodeURI or Google "javascript version of urlencode." Quote Link to comment Share on other sites More sharing options...
bluebutterflyofyourmind Posted July 18, 2008 Author Share Posted July 18, 2008 Haven't had chance to try it yet but that looks like exactly what i'm looking for. after passing that to my php script though, how do i work with what's passed? Do i need to decode? and if so how? thanks a ton! Quote Link to comment Share on other sites More sharing options...
corbin Posted July 18, 2008 Share Posted July 18, 2008 PHP should automatically handle the decoding. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.