- Code: Select all
<form action="feedback.php" method="post">
<div class="type"><input type="radio" name="type" id="compliment" value="compliment" /><label for="compliment">Compliment</label></div>
<div class="type"><input type="radio" name="type" id="complaint" value="complaint" /><label for="complaint">Complaint</label></div>
<div class="type"><input type="radio" name="type" id="general" value="general" /><label for="general">General</label></div>
<br />
<input type="submit" name="submit" class="begin_comments" value="Begin Comments" />
<br />
<br />
<br />
<span class="error"></span>
</form>
This form posts back to itself, and handles it like this:
PHP Code:
- Code: Select all
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['type'])) {
$_SESSION['type'] = $_POST['type'];
//echo $_SERVER['REQUEST_METHOD'];
header('Location: form.php');
}
else {
$error = 'You must select a comment type to begin';
}
}
However, when form.php loads, $_POST, $_GET, or $_REQUEST are all empty arrays. What could cause this?
Thanks!


