Wow thank you!! It all most work. There seems to be a problem with the MD5 hash. If I dont remove it, the script calls the error login. But as soon as I remove the MD5 hash, the script works perfectly. I dont understand it. Here is the script that stores the password with an MD5 hash:
<?php
include "sqlfunctions.php";
include "misc.php";
if(isset($POST['submit']))
if($POST['adminuser']=='' OR $POST['adminpswd']=='' OR $POST['adminemail']=='' OR $POST['sitename']==''){
registeradmin();
}else{
$adminuser=($POST['adminuser']);
$adminpswd=md5($POST['adminpswd']);
$adminemail=($POST['adminemail']);
$sitename=($_POST['sitename']);
sqladmin($adminuser,$adminpswd,$adminemail,$sitename);
forwardcp();
}
?>
And here is your script, as far as I can see, everything is as it is supposed to be:
<?php
include "sqlfunctions.php";
include "misc.php";
if (isset($POST['submit'])) {
if (empty($POST['adminuser']) || empty($POST['adminpswd'])) {
errorlogin();
} else {
$adminuser = $POST['adminuser'];
$adminpswd = md5($_POST['adminpswd']);
dbconnect();
$sql = "SELECT * FROM adminlogin
WHERE adminuser='$adminuser' AND adminpswd='$adminpswd'";
$result = mysql_query($sql)
OR errorlogin();
$row = mysql_fetch_assoc($result);
mysql_close();
if (mysql_num_rows($result) == 1) {
forwardtoindex();
} else {
errorlogin();
}
}
}
?>
So why doesnt it work?