Difficulty redirecting users after form submission
Posted: Fri Feb 20, 2009 10:59 am
Hiya,
I am building a script that checks to see whether the user accepts the site Terms & Conditions.
If the user checks "accept", the script should redirect to 'client_profile.php'.
If the user checks "decline", it should print an error message....
For some reason, the script runs, but it will not process any output to screen...
Whether I check "accept" or "decline" makes no difference....A blank white screen appears - except for the inclusion of the site's header and footer...
Here's my scripts:
Title: legalcheck.php
Title: check_legal_check.php
Any help would be apprecitated 
I am building a script that checks to see whether the user accepts the site Terms & Conditions.
If the user checks "accept", the script should redirect to 'client_profile.php'.
If the user checks "decline", it should print an error message....
For some reason, the script runs, but it will not process any output to screen...
Whether I check "accept" or "decline" makes no difference....A blank white screen appears - except for the inclusion of the site's header and footer...
Here's my scripts:
Title: legalcheck.php
Code: Select all
include ("inc/header.php");
$SiteFunctions->PrintNav("left");
Code: Select all
<div class="column_main"><br /><p> Please click on the link to view the site <a href="terms.php" id="terms"> Terms & Conditions </a></p><br /><p> You must accept the Terms before continuing into the website. </p><br /><form method="post" action="check_legal_check.php"/"><input type="radio" value="decline" name ="legals" id="decline" checked="checked" />I do not accept the terms<br /><input type="radio" value="accept" name ="legals" id="accept" />I understand and accept the Terms, and wish to proceed into the site<br /><p><input type="submit" value="submit" /></p></form><h2> Please note: you cannot proceed into the website unless you agree to these Terms. </h2><h2> If you do not agree, please log out of the system, as you cannot proceed any further. </h2></div> Code: Select all
include ("inc/footer.php");
Title: check_legal_check.php
Code: Select all
include ("inc/header.php");
$SiteFunctions->PrintNav("left");
if (isset($_POST['submit']))
{
//$message = NULL; //clear the variable.
if(isset($_POST["accept"])){
session_start();
header ("location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) ."./client_profile.php");
} else {
if (isset($_POST["decline"])){
$message .= "<p>You must accept the Terms to continue to the website</p>";
}
}
}
include ("inc/footer.php");