Hi guys,
My first post here after reading some very helpful responses over the last few months.
I'm having trouble passing radio button values to a results page and wondered if anyone would be able to spot anything wrong with the following code?
Any ideas are very much appreciated as this is the first time I've used PHP forms with radio buttons...
Here's the code section for the form page:
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$visitor_email = $_POST['email'];
$phone = $_POST['phone'];
$city = $_POST['city'];
$interest = $_POST['interest'];
$hear = $_POST['hear'];
$radioq1 = $_POST['radioq1'];
$radioq2 = $_POST['radioq2'];
$radioq3 = $_POST['radioq3'];
$radioq4 = $_POST['radioq4'];
$radioq5 = $_POST['radioq5'];
$radioq6 = $_POST['radioq6'];
$radioq7 = $_POST['radioq7'];
$radioq8 = $_POST['radioq8'];
$radioq9 = $_POST['radioq9'];
$radioq10 = $_POST['radioq10'];
$score = 0;
}
These are the NAMES for the form entries which then get POSTed to another page that just processes:
<?php
$points = $_POST['$score + $radioq1 + $radioq2 + $radioq3 + $radioq4 + $radioq5 + $radioq6 + $radioq7 + $radioq8 + $radioq9 + $radioq10'];
if ($points > 15) {
header('location: results-page.php?id=4');
} else if ($points > 11) {
header('location: results-page.php?id=3');
} else if ($points > 5) {
header('location: results-page.php?id=2');
} else {
header('location: results-page.php?id=1');
}
?>
The final page just shows the page and draws text and images from a database so simple stuff. The only thing is I can't get the values to add up! The result is always the same: results-page?id=1
Iknow it's something simple but my head hurts!!!