I guess i should explan my self better i have 4 pages i'm working with
question1.php
question2.php
question3a.php
question3b.php
question1.php is just a form and when the hit submit button it takes them to question2.php page where the information is inserted into a db and the user is asked another question. the question is yes or no and if they answer yes they go to question3a.php and if they answer no they go to question3b.php
bellow is the code i have for question2.php
I'm not getting any errors but i'm not even seeing the page anymore, i have placed the php code above the html code and it brings me directly to question3b.php, if the informatin is placed inside the html tage i get the above header error please help me i'm going crazy here
<?php
$db = mysql_connect ("localhost", "username", "password");
mysql_select_db("databasename", $db);
$sql = "INSERT INTO table (checkbox, checkbox2, checkbox3, checkbox4, checkbox5, checkbox6, checkbox7, checkbox8, Other) VALUES ('$checkbox', '$checkbox2', '$checkbox3', '$checkbox4', '$checkbox5', '$checkbox6', '$checkbox7', '$checkbox8', '$Other')"
;
$results = mysql_query($sql, $db);
if ($radio == "Yes")
{
$k = "Location: [url]http://www.cityscout.ca/survey/question3a.php?[/url]";
header($k);
exit;
}
else
{
$l = "Location: [url]http://www.cityscout.ca/survey/question3b.php?[/url]";
header($l);
exit;
}
?>
<html>
<head>
<title>ATM Survey Question 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="survey.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="form1" method="post" action="<? echo $PHP_SELF; ?>">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="28%"><h1>Question 2</h1></td>
<td width="72%"><h1> </h1></td>
</tr>
<tr>
<td>Do you have an ATM on Site?</td>
<td> </td>
</tr>
<tr>
<td><input type="radio" name="radio" value="Yes">
Yes</td>
<td> </td>
</tr>
<tr>
<td><input type="radio" name="radio" value="No">
No </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Next"></td>
</tr>
</table>
</form>
</body>
</html>