Help - Authentication library woes...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lujack76
Forum Newbie
Posts: 7
Joined: Mon Jul 15, 2002 3:08 pm
Location: Midwest USA

Help - Authentication library woes...

Post by lujack76 »

Hey, in advance I'd like to thank anyone generous enough to help me get this authentication library going.


I downloaded php_lib_login, the latest version, from http://homepage.mac.com/ghorwood/php_lib_login/, and I am having a whale of a time getting it working.

I have configured login.inc.php correctly, which is where the user/installer changes the appropriate variables such as server name, type, address, and then some variable which control admin options.

Each page which requires login is required to have login.inc.php as an include, and subsequently most of the page's code will call functions defined within the included file. I have followed the instructions, initialized all the user variables with my server name, etc.

Problem is, I cannot call any functions from the included file. I have tested the include function by including a simply HTML message, and THAT works, but for reason when I include "login.inc.php", which contains the crucial variable and function definitions, php cannot find the functions and I get an error "Function undefined."

This is driving me crazy. I've tried absolutely every configuration of every possible pathname, with no success. On top of that, when I use a relative path in the include, I get NOTHING to the browser, just air.

Any ideas? Again, thanks in advance.
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

There could be a parse error in the "login.inc.php" file, which would cause the function to not be recognized. Have you tried require('login.inc.php')? It'll catch any parse errors in the include file, I've been told.
lujack76
Forum Newbie
Posts: 7
Joined: Mon Jul 15, 2002 3:08 pm
Location: Midwest USA

Post by lujack76 »

Well, I just tried that and below is what appears. So I'm getting the HTML past the server, and apparently the include is successful, but the code in login.inc.php has as many bugs as that corridor in "Indiana Jones and the Temple of Doom."




Warning: Cannot send session cookie - headers already sent by (output started at /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php:2) in /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php on line 263

Warning: Cannot send session cache limiter - headers already sent (output started at /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php:2) in /Users/luke/Sites/PLI/passlib/php_lib_login_includes/login.inc.php on line 263

save the blink tag!
long before the world wide web had flash, or java or even pictures at all, there was the blink tag. the blink tag is the founding father of web animation and has set the standard to which all subsequent Òsticky content" must measure up! fight to defend our heritage...

save the blink tag!

blink defenders can log in here:

Fatal error: Call to undefined function: lib_login_valid_user() in /Users/luke/Sites/PLI/passlib/index.php on line 21
gnu2php
Forum Contributor
Posts: 122
Joined: Thu Jul 11, 2002 2:53 am

Post by gnu2php »

I wonder if you need to place require('login.inc.php') at the very top of your index.php file, or at least before anything gets outputted (or use output buffering). Because when there's any output, the headers are sent.
EricS
Forum Contributor
Posts: 183
Joined: Thu Jul 11, 2002 12:02 am
Location: Atlanta, Ga

Post by EricS »

The error your getting is telling you that the session_start() is not at the very top of the document.

You don't want anything except the <?php tag in front of the session_start(); function.
Post Reply