PHP

POST & GET Method in PHP



Receiving variables using GET Method

$variablename = $_GET['formvariablename'];

Note :The get method passes the variables along to the the php page from the form page by appending them onto the end of the URL.
For example if the form is in the page formpage.html and the php page is submit.php .
Inside the form tag it will be like form action=”submit.php” method=”get”
Suppose there is a textbox inside the form named txt.When we click the button,it will direct to the url submit.php?txt=”Text in the textbox”

Receiving variables using POST Method

$variablename = $_POST['formvariablename'];

Note :The POST method passes the variables along to the the php page as bytes of data,not appending to the url.

Share

Thanks for reading my blog. If you like what I write, why not subscribe to my feed?

If you are busy, I can send the latest post to your email. Just subscribe to my email updates.

 

Enter your email address:

Delivered by FeedBurner

Discussion

No comments for “POST & GET Method in PHP”

Post a comment