Question on Session
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Question on Session

From: <alucard001@gmail.com>
Date: Tue Oct 04 2005 - 06:12:38 CEST

Hi all!

I am a newbie in PHP and I have a question on using $_SESSION.

To keep it short, here is the code:

A.php:
<?php
if($_POST['username'] == 'USER' && $_POST['password'] == 'PWD'){
       $_SESSION['isLogin'] = 1;
      ?>
      <script language="javascript">
         window.location.href="B.php";
      </script>
      <?php
}
?>

B.php:
<?php
    print $_SESSION['isLogin'];
?>

Assume username and password is correct, but B.php show NOTHING!!!
That is, the $_SESSION haven't passed the value from one page to the
other page...

In php.ini: register_globals = On

My question is: how to pass the value from one page to another, without
using $_POST or some other things?

Thanks in advance.
Received on Tue Oct 18 02:31:15 2005