You are here: Re: Question on Session « PHP Programming Language « IT news, forums, messages
Re: Question on Session

Posted by Marcus on 11/30/67 11:28

alucard001@gmail.com wrote:
> 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.
>

Also, in your code you are using the $_POST and $_SESSION arrays, which
is how you should access these variables with register_globals being
off. Why not turn it off and make your system more secure?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация