Author Topic: .htaccess Alternative  (Read 2506 times)

0 Members and 1 Guest are viewing this topic.

Snowthrower

  • Guest
.htaccess Alternative
« on: March 30, 2005, 03:51:18 pm »
Does anyone know any secure alternatives to .htaccess besides Javascript? Right now the server that I am on does not allow .htaccess. I need to secure something as good as .htaccess would.

I have a nice PHP script, but I'm not sure how secure a password is in PHP.
« Last Edit: March 30, 2005, 04:04:19 pm by Snowthrower »

Offline winbindd

  • Administrator
  • SpongeBob
  • *****
  • Posts: 1,152
  • Gender: Male
    • View Profile
    • http://compbrain.net
.htaccess Alternative
« Reply #1 on: March 31, 2005, 07:04:22 pm »
You can store your password as an md5.
example

$mypasswordmd5 = md5('mypassword');
print $mypasswordmd5;

That will print a encoded irrevirsible version of the password. Then you can say,
$mypasswordmd5 = '78csd987das67da9dsa5';
 and check it with:

if(md5($givenpassword) == $mypasswordmd5) {
print 'Access Granted';
}