Foser Posted July 20, 2007 Share Posted July 20, 2007 I am making a script. and I need to use get statement. In my html form I have a multilined field. Can i put it in my get link.php?message=all of html field multilined or for get do I need to stick with single lined? thanks a lot! Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/ Share on other sites More sharing options...
lewis987 Posted July 20, 2007 Share Posted July 20, 2007 do you mean something like this? link1.php?val1=1&val2=1&val3=1 then all you would use for that would be: $val1 = $_GET['val1']; $val2 = $_GET['val2']; $val3 = $_GET['val3']; Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/#findComment-303437 Share on other sites More sharing options...
Foser Posted July 20, 2007 Author Share Posted July 20, 2007 But one of them would have an html entry which would be multi lined: like Hello, How are you? Cya! would i be able to put it as a get statement? thanks Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/#findComment-303441 Share on other sites More sharing options...
phat_hip_prog Posted July 20, 2007 Share Posted July 20, 2007 Have you tried it? If it converts lots of characters to '%20' things, there is a function somewhere for converting these both ways? Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/#findComment-303442 Share on other sites More sharing options...
lewis987 Posted July 20, 2007 Share Posted July 20, 2007 ahh, ok, if its being submitted from a field then all you have to do is add this code to where you want it $message = $_GET['message']; echo $message; html would show it up fine Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/#findComment-303445 Share on other sites More sharing options...
sKunKbad Posted July 20, 2007 Share Posted July 20, 2007 I found this info online: Recommendations Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don't use them if you intend your site to work for the majority of Internet users. When you wish to submit a form containing many fields, which would otherwise produce a very long URL, the standard solution is to use the POST method rather than the GET method: <form action="myscript.php" method="POST"> ... </form> The form fields are then transmitted as part of the HTTP transaction header, not as part of the URL, and are not subject to the URL length limit. Short-lived information should not be stored in URLs. As a rule of thumb, if a piece of information isn't needed to regenerate the same page as a result of returning to a favorite or bookmark, then it doesn't belong in the URL. So if you are going to use GET, you are subject to a 2000 character limit. Just urlencode(); the text in the form, and then urldecode(); it on the page where you are going to use it. Quote Link to comment https://forums.phpfreaks.com/topic/60983-multi-line-get-statement/#findComment-303480 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.