Page 2 of 2
Posted: Mon Apr 05, 2004 11:29 am
by magicrobotmonkey
Which one's line 53 in login.php?
Posted: Mon Apr 05, 2004 11:57 am
by jrmontg
<?php echo "$errorMessage"; ?>
Posted: Mon Apr 05, 2004 12:15 pm
by magicrobotmonkey
right. Now - look at that code on the previous page. See how $errorMessage is set after two separate if statements. If one of those fails then its not set. Obviously one is failing. I would guess the second, because we already fixed the first. Anyways, unless
<?php echo "$errorMessage"; ?>
has is not allowed to run unless $errorMessage is set, it will generate errors. So you have to either find out why $errorMessage is not getting set, or limit the above line to run only when errorMessage is set.
Similar Problem
Posted: Sun May 30, 2004 5:38 am
by anjanesh
Hello - Similar Problem
In a.php I have
Code: Select all
<?php
session_module_name("user");
session_set_save_handler("session_open","session_close","session_read","session_write","session_remove","session_gc");
session_start(); // Rest of the session fns are working including $PHPSESSID
$_SESSION['count']=5;
header("Location:b.php");
.
.
<session fns>
.
.
In b.php I have
Code: Select all
<?php
print($_SESSION['count']);
?>
This is what I get :
Notice: Undefined variable: _SESSION in b.php on line 1
register_globals = On. I'm using php4.3.4
Can anyone help me out here ?
Thanks
Posted: Sun May 30, 2004 11:51 am
by feyd
you need session_start() in all files you wish to have access to the session variables.
Variable not declared
Posted: Sun May 30, 2004 12:12 pm
by anjanesh
I did that too : session_start();
In that case it is showing that count is not declared
Posted: Sun May 30, 2004 12:19 pm
by feyd
have you tried it without your custom session handlers? have you tried adding the session handlers to b.php? have you tried print_r($_SESSION), just to see what is declared?
Posted: Sun May 30, 2004 4:58 pm
by yosuke_
Hi!
Well, I had (and still have) the same problem! I have that
undefined index error on IIS and Apache! I can't understand why!!!

I try everything, but nothing makes work sessions! I added
session_start(); on each page, but after 3 pages it lost session data!!
