View Single Post
  #10 (permalink)  
Old March 11th, 2006, 06:30 AM
Mantis Mantis is offline
Friend of Wrox
 
Join Date: Dec 2004
Location: London, London, United Kingdom.
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perso I won't use the $_SESSION['variable'] as a "variable carrier" - I had issue where PHP wouldn't return the variable in the past until I refresh the page..

What I do is assign the session variable to a variable just below the session start.

$staff_logged=$_SESSION['staff_logged'];

also looking at the code,
$q8 = "INSERT INTO fault(StaffID, Date, Time, Location, DeviceID, Problem_Desc)
        VALUES ('" . $_POST['StaffID'] . "', '" . $_POST['Date'] ."',
        '" . $_POST['Time'] . "', '" . $_POST['Location'] ."',
        '" . $_POST['DeviceID'] . "', '". $_POST['Problem_Desc'] ."');";

        $result = mysql_query($q8) or die(mysql_error());
        $_SESSION['staff_logged'] = $_POST['staffID'];
        $_SESSION['staff_password'] = $_POST['password'];

Try instead:
$_SESSION['staff_logged'] = $_POST['staffID'];
$_SESSION['staff_password'] = $_POST['password'];
$staff_logged = $_POST['staffID'];
$staff_password = $_POST['password'];

And modify your code; replace all the $_SESSION['staff_logged'] and $_SESSION['staff_password'] by $staff_logged and $staff_password.

On the next page $staff_logged=$_SESSION['staff_logged']; and $staff_password=$_SESSION['staff_password'];

Give that a try
Reply With Quote