hello I'm trying to use a form to post variables from an index.html to an action_page.php then somehow get those variables from a new results.html page (is this possible to do?)
my index form looks like this
<form action="action_page.php" method="post">
<select name="race" style="width: 180px;">
<option value="White">White</option>
<option value="Asian">Asian</option> //
</select>
my php looks like this
<?php
if(isset($_POST["formSubmit"]) )
{
$varRace = $_POST["race"];
$varAge = $_POST["age"];
echo $varRace; // this doesn't work why?
}
function redirect($url, $statusCode = 303)
{
header('location: ' .$url, true, $statusCode);
die();
}
$varRedirect = "results.html";
// call to function removed but it would call redirect($varRedirect);
?>
ultimately i'd like my results.html page to display a variable $varRace for instance.
since forms post to themselves is this possible to get ? is there a php function I could write to send the variable?
Aucun commentaire:
Enregistrer un commentaire