Post get
K like, your probable wondering, I can do all these things, but why would I want to, and then i would reply with "Because PHP can do user interactions" And then you would be all like, youve not told me how to do this. So here it is.
Like, learn html forms and stuff, this is a php tutorial, not a html one. So um, lets get up a form for all ya.
Now we must note some things down here.
action="color.php"
This will be the page that the php to get the information will be on
method="get"
The method where using to send the data
NAME="color"
The name of one set of data
So now for the php
You get the data by doing the following on the page "color.php"
$fav = $_GET["color"];
?>
Now break it down now
?>
To specify that the code is php
$fav =
To save the data collected in the variable "fav"
$_GET[""]
This is the method to get the data, the method goes here if you used the get method you must put $_GET[""] and if you used the post method you would use $_POST[""]
$_GET["color"]
and we slot the name of the data in the middle of the "" whitch we got in the NAME="color" of the form
And like now if you clicked blue on the form the variable "fav" would contain blue and if you clicked white it would be white. Now to do something with this code
$fav = $_GET["color"];
echo "your favorite color is $fav"
?>
And that would say what your favorite color is depending on what you clicked on in the form.