Creating login page

liunx

Guest
You know how you can pwd protect a folder in cpanel, and then when you get linked to a file inside that folder, it asks for a username and password? OK, is it possible to create a login on the page, where users can enter their login data, and it the directs them to the pwd protected page? Also, when they put in a wrong login, that they get a you're not authorized page, without the pop login showing up, allowing for two more tries. Any idea, suggestions? Thanks.<!--content-->
I would check out <!-- w --><a class="postlink" href="http://www.hotscripts.com">www.hotscripts.com</a><!-- w --> for a login script.<!--content-->
I agree with Bruce - If you don't want to see the popup login box, you'd need to take .htaccess out of the equation. You'd would therefore need a script to handle everything - the login, the display of the 'not authorized' page allowing another login attempt, and the display of the protected page.<!--content-->
Keep in mind that the weakness of using script logins to protect a folder is that it only protects your scripts from being accessed. For example you can use it to stop users from accessing .php pages but I don't believe you can't stop them from accessing resources such as images, simple html or other resources.<br /><br />If you do stick with HTTP authentication via .htaccess you can still access the username/ password information inside of scripts using variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']<br /><br />If you really don't want to use a popup login box there are techniques you can use to protect non script resources using php scripts. Place the resources in a location outside the public_html area and display them to your users via a php script.<br />See : <a href="http://www.phpdeveloper.org/section/tutorial/52" target="_blank">http://www.phpdeveloper.org/section/tutorial/52</a> for an example of this.<br /><br />hope this helps.<!--content-->
 
Back
Top