Languages :: PHP :: HTAccess login with PHP |
|||
| By: PHP newbee |
Date: 20/11/2002 00:00:00 |
Points: 50 | Status: Answered Quality : Excellent |
|
This might be a dumb question but I can't find the answer. Is there a PHP script (or any other) that will allow people to login to an HTAccess protected area through the web browser window and not the pop-up login? Thanks! |
|||
| By: VGR | Date: 21/11/2002 07:00:00 | Type : Answer |
|
| no and yes no directly (because it's your choice to have used .htaccess as a method of rights' handling) yes because you may use in stead standard HTTP Authentication via META-TAGS : (in PHP) : function authenticate() { Header( "WWW-authenticate: basic realm='My Authentication System'"); Header( "HTTP/1.0 401 Unauthorized"); echo "You must enter a valid login ID and password to access this resource\n"; exit; } if(!isset($PHP_AUTH_USER)) { // || ($SeenBefore == 1 && !strcmp($OldAuth, $PHP_AUTH_USER)) ) { authenticate(); } else while (($PHP_AUTH_PW!="hardcoded_password1")and($PHP_AUTH_PW!="hardcoded_password2")) authenticate(); // pas besoin d'une base de données |
|||
| By: monange | Date: 21/11/2002 21:56:00 | Type : Comment |
|
| yes and no: don't use .htaccess - store the login password into a database - create a form login / password. - check from the database or plain text (database is really better) - if yes put the session into the database. it allows you to expire the session when you wish then you're logged. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








