Posted by:
georgebaker
(---.cpe.ge-0-2-0-1101.hknqu1.customer.tele.dk)
Ohh man, i don't know where to start. Why is PHP and Apache so difficult to get up and running?
I have set privilegier for bob and admin, but after that i fucked up phpMyAdmin cause phpMyAdmin told me to set a password for the root user so i did and now i cannot get in to privilegier :-(
Next.
When i try to login as Bob it wouldn't allow me to do that with "bob" "1234" even though the password in the db show me that the password is "1234"(no encryption)
When i try to login as Admin with "admin" "1234" it logs me in but how can it do that with the password "1234" when it in the db is "81dc9bdb52d04dc20036dbd8313ed055" ?
The code is:
// Connect database.
$host="localhost"; // Host name.
$db_user="admin"; // MySQL username.
//$db_password="81dc9bdb52d04dc20036dbd8313ed055"; // MySQL password.
$db_password="1234"; // MySQL password.
$database="login6"; // Database name.
mysql_connect($host,$db_user,$db_password);
mysql_select_db($database);
// Check matching of username and password.
$result=mysql_query("select * from admin where username='$username' and password='$md5_password'"
;
if(mysql_num_rows($result)!='0'){ // If match.
session_register("username"
; // Craete session username.
header("location:main.php"
; // Re-direct to main.php