My sessions are doing some weird stuff. Firstly, I have register_globals on, and I am running php 4.4.2, Server API CGI, and register_globals is on.
page1.php has the
session_start();
$SESSION['institutionname'] = $POST['institutionname'];
and some querys that create a list of checkboxes for the user to choose one...the select go
now if I go to a page2.php
<?php
session_start();
$institutionname=$_SESSION['institutionname'];
require_once('checkpayment.php');
$conn = db_connect();
if (!$conn)
return 'Could not connect to database server - please try later.';
$query_payment = "SELECT paidflag, institutionname FROM users_tbl WHERE institutionname = '$institutionname'";
$institutionpayment = mysql_query($query_payment) or die("Problem with the query: $query_payment<br>" . mysql_error());
$row = mysql_fetch_array($institutionpayment);
$institutionname=$row['institutionname'];
if (isset($row['paidflag']) && $row['paidflag']=="0") {
header ("Location: https://mysite.info/page3.php");
exit();
}
if (isset($row['paidflag']) && $row['paidflag']=="1") {
header ("Location: https://mysite.info/page4.php");
exit();
}
?>
it might work...and then it might not...especially if I select the back button and try another checkbox.
so, I made page two another form with a text box that echos the institutionname. The problem... it might echo, and it might not.
so, what do I need to put on page1.php to unset the session and allow the user to select another insitution? unset and destroy doesn't work. Do I need to register the session, unregister then go back, ? if they select the back button things go wonky.
thanks