Hi.
I am developing an administration area that lets the admin to do some modifications.
I have created the login.php which contains a form that posts 2 variables:
$login_username & $password.
Now, I have a table (admin_table) in my database which contains 3 fields (admin_id,username,password).
This table has only 1 record since there should be only 1 admin.
Inside the administration area I have created a file called init.php.
No one can access this file except the admin since it is inside the administration area.
(I am using sessions for security, so any one who would try to access any file will be redirected to the login.php).
The purpose of the init.php is to initiate the login name and the password as follows:
$login_username = admin111;
$password = "admin111";
$password = MD5($password);
mysql_connect ("localhost","root","");
mysql_select_db (db_name);
$q_result = mysql_query("update admin_table set username = '$login_username' , password = '$password'
where admin_id = '1'");
My questions are:
1- When I executed init.php and then logged out, I tried to login with the username (admin111)
and the password (admin111), but I couldn't ????
2- I am using md5() for Encription as shown above. Do I need to Decript the password when validating the form?
3- Am I using the correct methology for achieving my administration area, or there could be a better way?
Note that I am getting something like 'bbad8d72c1fac1d08172' as a password when I do select.
Pleeeeeeeeeeeease Help
Thx