RE: Session variables when global variables switched off [Sorry, firs t message accidentally fired off to quickly ]

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

 



Try changing your code to 

if ($_SESSION['verified'] != "yes"){

I think that's the problem

Nick



-----Original Message-----
From: Baumgartner Jeffrey [mailto:j.baumgartner@itp-europe.com]
Sent: 18 February 2003 11:20
To: 'php-db@lists.php.net'
Subject:  Session variables when global variables switched off
[Sorry, firs t message accidentally fired off to quickly ]


[sorry for the incomplete posting of a couple moments ago. I hit ctl
something or other and outlook fired off the e-mail against my wishes!]

I am making a section on a web site which requires that visitors log-in.
Log-in, password, etc are in an MySQL table. I am using (via a web host) PHP
4.2.2 with global variables turned off. Until now, I have worked with a
different host in which global variables were switched on.

The way it works
The user logs in at index.php. When she does so successfully, index.php
returns a menu of links. However, if she clicks on any of those links, which
are different pages, she gets a please log-in first message because each
page includes...

if ($_SESSION['verified'] <> "yes"){
echo "<P><a href='index.php'>Please log in first</a></P>";
exit();
}

Returning to index.php requires a log-in again.

So, it seems the session variable is not being sent being sent between
pages, although it works within the same page. I expect I am missing
something obvious. I've made this kind of thing work with global variables
on - so I assume I am misunderstanding something related to lack of global
variables. 

I use 

session_start(); 

at the top of all pages and  

session_register($_SESSION['okbabe']); 

on index.php.

Your enlightenment will be highly appreciated.

Jeffrey Baumgartner


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux