Jump to content

Archived

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

lcruz

Difference POST and GET

Recommended Posts

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

Share this post


Link to post
Share on other sites
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']

Share this post


Link to post
Share on other sites

×

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.