aximbigfan Posted March 23, 2008 Share Posted March 23, 2008 Anyone know why this is happening? When I post certain characters, they don't show up after they are posted. Here is a list of characters it will allow ~!@#$%^ All else are stripped. Thanks, Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/ Share on other sites More sharing options...
MadTechie Posted March 23, 2008 Share Posted March 23, 2008 need some sample code really.. if your posting via GET that could be the reason.. Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499058 Share on other sites More sharing options...
aximbigfan Posted March 23, 2008 Author Share Posted March 23, 2008 Posting via post, not get. All it is doing is posting from a text field, but it is through AJAX. Hmm... that got me thinking. Is AJAX doing it? Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499065 Share on other sites More sharing options...
MadTechie Posted March 23, 2008 Share Posted March 23, 2008 it could until i see something i can't say, before returning it to the ajax (for the callback) try using urlencode see if that helps (again i am guessing here, without seeing anything i can't do much more) Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499075 Share on other sites More sharing options...
aximbigfan Posted March 23, 2008 Author Share Posted March 23, 2008 I figured part of it out. It strips ANYTHING after "&" anyway to escape &? Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499079 Share on other sites More sharing options...
MadTechie Posted March 23, 2008 Share Posted March 23, 2008 AJAX was using GET then Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499081 Share on other sites More sharing options...
aximbigfan Posted March 24, 2008 Author Share Posted March 24, 2008 It is set to post, but, how can I rig it to some how allow &s? Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499084 Share on other sites More sharing options...
MadTechie Posted March 24, 2008 Share Posted March 24, 2008 you could do this on the callback (PHP side) depends on the code.. <?php $data = "hello & world"; $data = rawurlencode($data); // hello%20%26%20world echo $data; ?> then on the javascript side use decodeURIComponent ie <script type="text/javascript"> var test1="hello%20%26%20world"; document.write(decodeURIComponent(test1)); </script> Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499091 Share on other sites More sharing options...
aximbigfan Posted March 24, 2008 Author Share Posted March 24, 2008 I think it is already urlencoded, but I'll try this. Thanks! Hold on a few minutes and i'll try it... Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499128 Share on other sites More sharing options...
aximbigfan Posted March 24, 2008 Author Share Posted March 24, 2008 UPDATE: The problem actually occurs when the data is SENT to the server, rather than on the callback.. Is there someway I can encrypt the data in a manor that uses ALL plain text? (ie, abcdefghijklmnopqrstuvwxyz) Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499130 Share on other sites More sharing options...
MadTechie Posted March 24, 2008 Share Posted March 24, 2008 when sending use encodeURIComponent("blar&blar"); or update the ajax to use post instead of get Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499147 Share on other sites More sharing options...
aximbigfan Posted March 24, 2008 Author Share Posted March 24, 2008 It's weird, because it is setup to post, but it seems to be GETing, for example, it will handle more than 100 characters, so it isn't GETing, but it seems like it is. Anyway, I'll do that, THANKS! Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499176 Share on other sites More sharing options...
aximbigfan Posted March 24, 2008 Author Share Posted March 24, 2008 PERFECT! It works perfectly! Thanks a bunch MadTechie! Chris Quote Link to comment https://forums.phpfreaks.com/topic/97537-stripping-_-and-other-charactors/#findComment-499180 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.