Re: Session Question
| From: | Pushpinder Singh Garcha | Date: | Wed, 21 May 2003 19:51:23 +0000 |
| Subject: | Re: Session Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148435@lists.php.net to get a copy of this message | ||
Thanks,
register_globals is ON on my site. I am using sessions in the following was
// start of snippet
$sql1 = "SELECT * fromtestwherelogin= '$login' andpassword= '$password' andpriv_level> 0" ;
$result1 = mysql_query($sql1)
or die ( 'Database Error has occured.');
$num_results = mysql_num_rows($result1);
if ($num_results == 1 ) { while ($row = mysql_fetch_array($result1, MYSQL_ASSOC)) {
$valid_user = $row["login"]; $firstname = $row["first_name"]; $lastname = $row["last_name"]; $days_left = $row["days_left"]; $pass = $row["passport_number"]; $first_visit = $row["first_visit"];} session_register("valid_user","firstname","lastname"); // end of snippet My question was that can I use session in the following manner.? // Start of test code session_start(); if (session_is_registered("valid_user")) { if ($valid_user = "advanced_user") { fopen('http://www.somesite.com/advanced_user.html'); } } // end of code Thanks in adavnce --Pushpinder On Wednesday, May 21, 2003, at 03:06 PM, Ernest E Vogelsinger wrote:
Having however a "name" field in the $_SESSION array then the approach might be possibly secure, depending on a couple of other factors: - register_glob