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 Code:
<?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.
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.
GET can still be used to retrieve information from a form, it's just that that information is passed from the form to the server via the address / URL.
Traditionally, GET was used as a way of getting information whereas POST was used to send information. That is to say, traditionally a GET request should not make changes on the server (whereas POSTs can).
This is actually a good way to think, anyway. People that have browser accelerators that prefetch URLs will have lots of problems if GET type URLs are prefetched and if those URLs actually make a change on the server. Imagine prefetching 100s of URLs that are actually 'Delete this Entry' type URLs!
Would echo Thank you $name for soemthing bla bla. You would need to use double quotes or [..] you ' . $name . ' for [..] to make it actually say the name.
I think that depends on php.ini settings. I forget the setting, but if is enabled, you can stick variable names inside strings and they will be parsed. (It's horrible though)
yes NetworkTown.Net that is another method to insert a variable into a string. That method is called concatenation. Some people prefer 1 method over the other I personally prefer concatenation over variables in double quotes as it is easier for me to see.