Logo

Pass form variables to another page

Posted under » PHP on 13 March 2009

This is how you get data from a form.

The post method is the preferred method because the variables are hidden from view thus making the URL look much neater.

$name = $_POST["name"];
$email = $_POST["email"];

This is how you get data from the URL method.

$name = $_GET["name"];
$email = $_GET["email"];