|
I'm using Jpmaster77 a.k.a. The Grandmaster of C++ 's register/login system and I'm having a problem with the session being dropped when I try to submit a form to the same page.
A user has to register and login to access the form. The information on the form is suppose to be entered into a database and the user given an all OK message, with the user options shown at the top.
The form I'm using is a copy of a working form with only the database info changed. However, the information isn't being entered into the database and when the page is displayed again it says I have to login.
So I don't know if whether the form is interfering with the session or the session with the form.
This register/login system uses a sessions.php page that you include at the top of the pages you want the session information added to. Here's the scenario:
[PHP]
<?php
include("include/session.php");
?>
<?php
include('functions.php');
head();
?>
<?php
// begin session login check
if($session->logged_in){
echo "
<strong>$session->username</strong>, you are logged in.<br>
$session->company<br>
$session->email<br>
$session->address<br>
$session->city, $session->state $session->zip<br><br>
[<a href=\"userinfo.php?user=$session->username\">My Account</a>]
[<a href=\"useredit.php\">Edit Account</a>]
[<a href=\"process.php\">Logout</a>]<br><br><hr>
";
// process form results
submitted form process section
?>
<form>
Field 1
Field 2
</form>
<?php
} else {
echo "You must <a href='main.php'>Login</a> to access this page.";
}
?>
<?php
footer();
?>
[/PHP]
|