Re: header() and passing sessions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



abdulazeez alugo wrote:

Hi,
Well I'ld say the reason is quite obvious. You have simply not set $_session["username"] . I'ld have done something like: -- option.php --
<?php
 session_start();
 if ($_POST["option"] == "View Pending Requests")
{
$_session["username"]= true;  //sets the session
header('Location: http://intra.mdah.state.ms.us/helpdesk/viewpending.php?PHPSESSID='.SID); // <http://intra.mdah.state.ms.us/helpdesk/viewpending.php?PHPSESSID=%27.SID%29;%A0%A0%A0+//> I'ld use SID
 }
 ?>

--viewpending.php -
 <?php
 session_start();
 if ($_SESSION["username"] !=true)
 {
 echo "You have not logged in";
 exit;
 }
 ?>
I hope this helps. try it.
Cheers
Alugo Abdulazeez



Well the thing is, $_SESSION["username"] is set.  If I change option.php to:

<?php
session_start();
echo "session username is ".$_SESSION["username"];
/*if ($_POST["option"] == "View Pending Requests")
       {
header('Location: http://intra.mdah.state.ms.us/helpdesk/viewpending.php?PHPSESSID='.session_id());
       }
*/
?>

and click on View Pending Requests, it prints:

session username is awilliam



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux