louis_coetzee Posted March 10, 2009 Share Posted March 10, 2009 Hi guys, sorry for what i am about to ask, if it is to of a stupid question, but....okay here it goes. Normally when you use <form method="get" action="what.php"> <input type="text" name="textfield" id="textfield" /> <input type="submit" name="button" id="button" value="Submit" /> </form> this would look something like this: http://localhost/what.php?textfield=enteredtext This is how I use it how does this work? http://www.anc.org.za/show.php?doc=lists/miscpix.html it is the normal show.php?doc=list /miscpix.html don't understand how this works? (I don't understand the bolded part) and for example when you get a # in the url? What is it used for? How does all this work? Is there somewhere that I can go and read about this? Thanks in advance. Louis Link to comment https://forums.phpfreaks.com/topic/148775-get-posting/ Share on other sites More sharing options...
premiso Posted March 10, 2009 Share Posted March 10, 2009 That code essentially includes a file in the path of lists/miscpx.html to make it more "dynamic". Without the proper code, that could be a very bad thing allowing your site to be hacked. As far as the # in the url, maybe look into the urlencode function at php.net. Get data has to "flow" so as such spaces turn into %20 and other items are changed as well. EDIT: To further clarify, you do not have to post from a form to set get data. I can set it to be anything by typing it in the browser or adding it to a link on a website. http://www.google.com/search?q=test should run a google search on "test". That is why GET data is for, so you can bookmark/link a site and go right to that page, vs having to just goto google.com and re-type it in. Link to comment https://forums.phpfreaks.com/topic/148775-get-posting/#findComment-781197 Share on other sites More sharing options...
Maq Posted March 10, 2009 Share Posted March 10, 2009 Here's a Basic Example. Link to comment https://forums.phpfreaks.com/topic/148775-get-posting/#findComment-781201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.