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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.