Forum Moderators: coopster
For some reason IE and OPERA are not finding the session variable (in this case $_SESSION[‘terms’]) after redirection using header(location:’thepage.php’). Part of the problem seems to be that each page validates itself. I’ve remedied the problem by using another URL for validation and registering $_SESSION variables, but for a number of reasons I’d like to keep everything on the same page.
I’ve done a lot of reading about IE and its finicky nature with headers but nothing seems to solve the issue. Any ideas?
-PHP is running as a CGI module which I tend to think may have something to do with this.
Any help is greatly appreciated.
<?php
session_start();
// Include the configuration file for error management and such.
require_once ('config.inc.php');if (isset($_POST['submitted'])) { // Handle the form.
require_once ('mysql_connect.ini.php');if (isset($_POST['terms'])){//make sure the visitor clicked a choice
if (eregi('^[a-zA-Z]{10,12}$', stripslashes(trim($_POST['terms'])))) {
$terms = escape_data($_POST['terms']);if ($terms === 'acceptTerms'){
$_SESSION['Terms'] = $terms;
header ("Location: [somesite.com...]
exit;
} else {
echo 'Error - The system has encountered an error.';
}} else {
echo 'No terms - no go';
}} else { //else for missing terms -- show visitor error notification prompting a choice
//<!-- Error array form message here form here -->
}// end error notification conditional
} else { //the form has not been submitted - show the page
//<!-- Not yet submitted html form here -->
}
?>
I changed the graphical submit buttom to straight html and everything worked fine.
For what it's worth if anyone else is having a similar issue.