NetworkTown.Net
Account Closed
- Impact
- 2
Hi
Im going to explain $_POST & $_GET that iv learnt about on php.net,
$_POST is used to get infomation from a form like say your form was like this:
Now when that form gets submitted you want to get the persons name to show it up on the thank you page or something you use $_POST to get the name. You do that by doing this:
So thats how you use $_POST now i will show you how to use $_GET
you use $_GET to get infomation that is in the address bar, this is how to use it.
Now $_GET will go to the address bar and find name= for example if your address bar address was: http://www.site.com/index.php?name=john
The script will get john as the name and put that in the sentence. Hope this helps took me a bit of time to figer it out on php.net but i got there and i though i would share it here.
Im going to explain $_POST & $_GET that iv learnt about on php.net,
$_POST is used to get infomation from a form like say your form was like this:
HTML:
<form action='something.php' method='post' enctype="multipart/form-data">
<input name="name" type="text" size="45" />
</form>
Now when that form gets submitted you want to get the persons name to show it up on the thank you page or something you use $_POST to get the name. You do that by doing this:
PHP:
<?php
$user = $_POST['name'];
//the place where it says name is that name of the form //above thats where the user puts there name and the form box is called name
echo 'Thank you $user for submitting your infomation to our site bla bla';
?>
So thats how you use $_POST now i will show you how to use $_GET
you use $_GET to get infomation that is in the address bar, this is how to use it.
PHP:
<?php
$name = $_GET['name'];
echo 'Thank you $name for soemthing bla bla';
?>
Now $_GET will go to the address bar and find name= for example if your address bar address was: http://www.site.com/index.php?name=john
The script will get john as the name and put that in the sentence. Hope this helps took me a bit of time to figer it out on php.net but i got there and i though i would share it here.