Helpful Information
 
 
Category: Programming Languages
PHP3 to prompt for userID password..How to

Is there any information on how to make the PHP3 prompt for a userID and password and authenticate the user.

Any information is appreciated

Suresh Kumar

I would suggest taking a look at PHPLib. It allows for user authentication based on password, permissions and other flexible methods. It's not easy to implement, but it's worth it.

See:
http://phplib.shonline.de

Otherwise, for a less flexible solution,
you can integrate PHP with Apache's standard HTTP authentication (if running as Apache module).

See:
http://www.php.net/manual/features.http-auth.php3

Thank you jpenix for the info.
The PHPLIB document is pretty straight forward and I was able install PHPLIB in minutes and the samples are working.

...now I need more samples I guess, because the my homepage is prompting to enter the password everytime i refresh or
give a search command. (Yes, Navigator is setup to accept cookies).

Can I get some more samples for this PHPLIB

Tks

Suresh Kumar

How to make PHPLIB remember and display my user-id when I login the next time?
"Accept Cookie" is enabled in Netscape.

(I have fixed the problem of user id password prompt by enabling the cookies, I set it incorrectly to accept cookies from certaing sites only before)

Any Idea?

Suresh Kumar

------------------

After passing the password you may use something like:

Header("Location: pagein.php3?ID=$u&PW=$p");

or

Header("Location: pagein.php3?UID=$uid");

Redirecting to pagein.php3 with Username and Password or even sending a UserID.

Pagein.php3 shall create a new page with that results in an input hidden something like this:

<INPUT NAME="UID" VALUE="<? echo "$uid" ?>">

when you refresh the pagein.php3 it contains the $uid and you will process it with no problem.

I've used something like it to pass values of variables thru 3 input data screens in one script and to another script without using "cookies". You know. You shouldn't use "cookies" because some people doesn't like them at all and if your script uses it it may not work.

Another system is to use the IP address and
keep it somewhere in your system. Then test if they are trying to get in again.

It wont work with Proxy Servers. The best way is to use both and "cookies" too.

See www.php3.net for samples in Advertising Systems. They usually track all this.

Best regards.

------------------
Projecto EINet










privacy (GDPR)