Hello
I am getting an error upon executing a page that has an include containing all of the pre-defined functions of this auth library, php_lib_login.
The error is that "function is undefined," and yet my include syntax and path are correct. I substituted some sample text php files to make certain, and the include looks OK. So when I include "login.inc.php," I cannot imagine why PHP is not able to find the function, which I have verified exists and is spelled correctly.
In summary, the include with all the variables and crucial functions is "invisible" to php. How can this be? This is blowing my mind.
Thanks in advance.
user authentication with PHP
Moderator: General Moderators
in my experience, this has been an issue with the function itself. You'll be able to include the library (login.inc.php), but the functions won't be visible if there are syntax errors (often a missing bracket or something). try loading just the library file in a browser (just add an echo'login library'; somewhere so it won't hang in the browser forever). let us know if this doesn't help.
actually i said to "load the library _in a browser_". instead of going to http://www.mysite.com/index.php, go to http://www.mysite.com/login.inc.php. if there are syntax errors in that document, it'll tell you. actually, it should probably throw the errors when you include it, but it can somtimes get hidden.
if login.inc.php doesn't output anything anywhere, it will 'hang' in the browser, so add an echo 'foobar'; or something somwhere to prevent this.
if login.inc.php doesn't output anything anywhere, it will 'hang' in the browser, so add an echo 'foobar'; or something somwhere to prevent this.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
OK, I stuck a print line into the library file, loaded it in the browser, and the print line executed but here's what followed:
Warning: Cannot send session cache limiter - headers already sent (output started at /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php:1) in /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php on line 263
So is there something wrong with the login.inc.php on line 263? Here is what the file has at that point:
262 //$gDB->debug = true; //update
263 session_register('gUser');
264 if (empty($gUser)) $gUser = '';
Again, appreciate any assistance.
Warning: Cannot send session cache limiter - headers already sent (output started at /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php:1) in /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php on line 263
So is there something wrong with the login.inc.php on line 263? Here is what the file has at that point:
262 //$gDB->debug = true; //update
263 session_register('gUser');
264 if (empty($gUser)) $gUser = '';
Again, appreciate any assistance.