Hey there,
Just a quick question,
If I have a password hard coded into a .php file, so if anyone opens the file in a text editor or something they can see it, is there a way to encrypt it,, so it will appear in random charactors or something?
thanx in advanced
Encryption help
Moderator: General Moderators
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
sorry for being a n00b, I don't really get it
if I have this
how would I use that code to make bob2 encrypted
if I have this
Code: Select all
if('bob' == $_POST['user_name'] and 'bob2' == $_POST['password'])
{
header('Location: authenticated.php');
}firstly, you'd have to store the password already hashed
so instead of
user: bob
password: mypassword12
you'd have
user: bob
password: somehashedvaluehearthatisn'treadable
then when you're doing your check you'd do something like this
so instead of
user: bob
password: mypassword12
you'd have
user: bob
password: somehashedvaluehearthatisn'treadable
then when you're doing your check you'd do something like this
Code: Select all
if(($_POST['username'] == 'bob') && (md5($_POST['password']) == 'bobspassword')))
{
header('Location: authenticated.php');
}Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.