943,946 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 18539
  • PHP RSS
Sep 9th, 2005
0

PHP .htaccess form

Expand Post »
For my website, I'm trying to create a login form where visitors can type in their login/password, and have PHP check that login with HTTP Authentication (.htaccess). So instead of user typing in the direct URL and entering their user/password in the pop up box, they could simply do it from a form. I was wondering if this was possible and if so how? In case you're wondering, I want to do this for conviences and design purposes. Thank you!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
vartotojas is offline Offline
29 posts
since Aug 2005
Sep 9th, 2005
0

Re: PHP .htaccess form

This speaks of very poor design. It would make sense to use PHP to modify/maintain .htaccess files, but it doesn't make sense to use .htaccess files as a storage place for PHP user logins. If you like the concept of using a file, rather than a database, to store username/password combos, why don't you just put a plain-text file outside of the web-accessible directory structure and authenticate off of that?

Now if you are talking about using PHP to grant HTTP Authentication using the .htaccess file and bypassing the typical login pop-up, that is another question altogether. I don't think it is possible, but I will look. I still think it would be better design to stay away from the HTTP Authentication model completely if you don't really want to use it.

You might want to read this PHP-Based User Authentication guide for beginners for some ideas.
Reputation Points: 38
Solved Threads: 25
Posting Shark
chrisbliss18 is offline Offline
902 posts
since Aug 2005
Sep 10th, 2005
0

Re: PHP .htaccess form

hi vartotojas,

well from my own project, what i did was i had a table in the database that consists of all the username and passwords(encrypted form) after which, i created a login form using html with username and password boxes. Then i create a php script that will capture the username and password entered and compared it with the table i had created in the database that consists of the members' names and passwords. If match, the user can log in, if not it will not be allowed to log in.
Furthermore, u can read up more on php sessions. Hope it helps

http://www.php.net/session

rgds,
tris
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
tristan17 is offline Offline
51 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: change backslash to foward slash
Next Thread in PHP Forum Timeline: php_value append/prepend question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC