jonnewton Posted January 9, 2008 Share Posted January 9, 2008 I am using an html form that is returning data from a textarea box. It sends the data via GET to a confirmation page. If users confirm, it sends the data to a MYSQL db. All is well unless someone enters a carriage return (Return key/line break) in their text. If they do, they see a page that says "Bad request! Your browser sent a request that this server could not understand" In the command line, it appears that the carriage return shows up as this: %0D%0A I did a string replace on the confirmation page that replaces that string with a space, but apparently the replacement occurs after the data has been sent to the, um, server in the command line. I don't know of a way to process the data in the original form before it has been sent via GET. Any insight would be very much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/85244-solved-remove-carriage-return-from-form-data/ Share on other sites More sharing options...
kenrbnsn Posted January 9, 2008 Share Posted January 9, 2008 Change the method your form uses to "post". Ken Quote Link to comment https://forums.phpfreaks.com/topic/85244-solved-remove-carriage-return-from-form-data/#findComment-434864 Share on other sites More sharing options...
drummer101 Posted January 9, 2008 Share Posted January 9, 2008 Do you *aboslutely* have to use $_GET? $_POST is must simpler and easier, not to mention more elegant to use for textarea submission. Also, %0D%0A = \n Quote Link to comment https://forums.phpfreaks.com/topic/85244-solved-remove-carriage-return-from-form-data/#findComment-434865 Share on other sites More sharing options...
jonnewton Posted January 10, 2008 Author Share Posted January 10, 2008 I switched to POST and that worked fine. I really appreciate the help guys! Quote Link to comment https://forums.phpfreaks.com/topic/85244-solved-remove-carriage-return-from-form-data/#findComment-435143 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.