<form action="somesite.com" name="somename">
<input type="text" name="data" value="">
</form>
If I try to execute this code in my local system, the value with the name ‘data’ will be transferred to the site ‘somesite.com’
Is it the right way to transfer the data to any other web site which already exists? What will happen to that data (if successfully transferred to somesite.com)?
In general, what exactly happens to the value of ‘data’ if we dont use that value in any part of our script?
Hope I am clear???
If
datais not processed by the script running on the server receiving the HTTP Request, it is gone afterwards.Your browser creates an HTTP request with the form data when you submit the form and sends it to the webserver specified in the form action. The webserver just knows how to handle the HTTP Request as such. Your PHP scripts have to know how to handle the data within the HTTP Request. HTTP is a stateless protocol, so there is nothing stored by the webserver.
Note: technically, when receiving GET requests with added params, you might find them in your webserver’s access log, so they are stored, but it’s not like you would reuse them from there.
Have a look at the Firefox addon Tamper Data to see what happens when you submit a form. If you want to use IE, try Fiddler.
As to whether you should use GET or POST as a form method, stick to the W3Cs recommendation: