Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Password


ghost's Avatar
0 0

I made a personal website and i'm wondering what the best password protection would be? it would be best if it was encrypted too.

thx alot.:D


ghost's Avatar
0 0

You should tell us for what you need password (for some part of site, ligin sistem etc.)?


ghost's Avatar
0 0

i think he means for the database, just use this:

when u add them to database do it like this:

$username =$_POST['username']; $password = md5($_POST['password'];

mysql_query("Insert into bla bla bla VALUES($username,$password)");

then when they log in…

$username =$_POST['username']; $password = md5($_POST['password']); $result = mysql_query("SELECT * FROM table where username=" . $username); $dbpass = mysql_result($result,0,'field_name_for_pass'); if ( $dbpass == $password ) { echo 'logged in'; } else { echo 'denied'; }

That obviously wont work, just a basic structure to how most people do it.


ghost's Avatar
0 0

im not that good at writing php … but i might suggest adding this to make sql injections harder..

str_replace("'" , "\'" , $username );
str_replace("'" , "\'" , $password );

ghost's Avatar
0 0

Except srt_replace use mysql_real_escape_string, it is much more reliable.


ghost's Avatar
0 0

yeah what i meant was that as soon as you enter the main page a pop up would appear. and then a you would have too enter a password. but if you got it wrong the first time you would be redirected.


ghost's Avatar
0 0

like a .htpasswd ?


ghost's Avatar
0 0

yeah

that's exactly what i want


ghost's Avatar
0 0

i know about the encrypter but how do i actually use the .htaccess and .htpassword files in my website? and what do i put in the files. im n00by at this so plaese help me.

EDIT: al i want is so that when i click on a link on my page that a prompt comes up and asks me for a password. i enter it, then i get in. but i don't want anyone gettin in.


ghost's Avatar
0 0

Usually the most simple way to set password on directory is to secure this folder via cpanel. If your host doesn't have cpanel google for some htaccess tutorial.


ghost's Avatar
0 0

I reckon if you just leave a comment in the source giving a false password unencrypted. It will have 10000's of n00bs confused.

comment in source = <!–1337llama0wn5–>

noob1 - "why isn't this working"

noob2- "omg Its like a basic challenge or something"

noob1 - "I think its encrypted, what do you think"

noob2 - "Yeah it must be,try MD5"

hehe;)


SySTeM's Avatar
-=[TheOutlaw]=-
20 0

cubeman372 wrote: I reckon if you just leave a comment in the source giving a false password unencrypted. It will have 10000's of n00bs confused.

comment in source = <!–1337llama0wn5–>

noob1 - "why isn't this working"

noob2- "omg Its like a basic challenge or something"

noob1 - "I think its encrypted, what do you think"

noob2 - "Yeah it must be,try MD5"

hehe;)

HAHAHA THAT'S GREAT!

It's also very true!


ghost's Avatar
0 0

cubeman372 wrote: I reckon if you just leave a comment in the source giving a false password unencrypted. It will have 10000's of n00bs confused.

comment in source = <!–1337llama0wn5–>

noob1 - "why isn't this working"

noob2- "omg Its like a basic challenge or something"

noob1 - "I think its encrypted, what do you think"

noob2 - "Yeah it must be,try MD5"

hehe;)

LMAO that's great. I can see the fourm post now.


ghost's Avatar
0 0

cubeman372 wrote: I reckon if you just leave a comment in the source giving a false password unencrypted. It will have 10000's of n00bs confused.

comment in source = <!–1337llama0wn5–>

noob1 - "why isn't this working"

noob2- "omg Its like a basic challenge or something"

noob1 - "I think its encrypted, what do you think"

noob2 - "Yeah it must be,try MD5"

hehe;)

LMAO that's great. I can see the fourm post now.