If you submit a form such as this:
Code:
<form name="input" action="index.php"
method="get">
Username:
<input type="text" name="user">
<input type="submit" value="Submit">
</form>
As you can see in the first line, the method is "get" meaning it will return this: "index.php?user=EnteredUserData&submit=Submit"
This means if you want to set a variable to be one of those, use this:
Code:
$thename = $_GET['user'];
echo $thename;
The other mode, post, would be like this:
Code:
<form name="input" action="index.php"
method="post">
The url will be "index.php" after being submitted.
To get the post variables, do something like this:
Code:
$theothername = $_POST['user'];
echo $theothername;
Bookmarks