Jump to content

Difference POST and GET


lcruz

Recommended Posts

You only use POST when you use [b]post[/b] as the [b]method[/b] you wish to submit a form. ie:
[code]<form action="test.php" method="post">
<input type="textbox" name="name"><br />
<input type="submit" name="submit" value="Submit Name">
</form>[/code]
If you dont use the mothod attribute within your html form tag then you will need to use GET. As the information is being submitted over the url. You can also use the GET mothod with links:
[code]<a href="test.php?var1=hello&var2=world">Some link</a>[/code]
You are setting two variables which are var1 and var2 in order to retrieve the value of these variables you use the following code $_GET['var1'] and $_GET['var2']
Link to comment
https://forums.phpfreaks.com/topic/5590-difference-post-and-get/#findComment-19940
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.