Jump to content


Photo

Difference POST and GET


  • Please log in to reply
1 reply to this topic

#1 lcruz

lcruz
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 March 2006 - 01:46 PM

I am little bit confused, i dont know where i need to use POST or use GET, could anyone gave me a tip where is recommended to use one of those,


thnk you

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 23 March 2006 - 01:52 PM

You only use POST when you use post as the method you wish to submit a form. ie:
<form action="test.php" method="post">
<input type="textbox" name="name"><br />
<input type="submit" name="submit" value="Submit Name">
</form>
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:
<a href="test.php?var1=hello&var2=world">Some link</a>
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']




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users