ok pyro, i am trying to adapt your old login script to use a MySQL database. heres the code i have so far:
[code=php]<?PHP
mysql_connect(“srry”, “srry”, “srry”) or die(“Could not connect: ” . mysql_error());
mysql_select_db(“srry”);
$result = mysql_query(“SELECT `name`, `pass` FROM `Users`”);
$row = mysql_fetch_array($result, MYSQL_BOTH);
$usernames = “‘” . $row[“name”] . “‘, “;
$passwords = “‘” . $row[“pass”] . “‘, “;
mysql_close();
$x = 1;
$user = array($usernames);
$pass = array($passwords);
for ($i=0; $i < count($user); $i++) {
if ($x == 1) {
if ($_POST[‘username’] == $user[$i]) {
if ($_POST[‘password’] == $pass[$i]) {
session_start();
$_SESSION[‘verified’] = true;
header (“Location:[url]http://xaxei.subsilvernet.com/helloworld.php[/url]”);
}
else {
header (“Location:[url]http://xaxei.subsilvernet.com[/url]”);
}
$x .= 2;
}
}
}
if ($x == 1) {
echo “<BODY bgColor=#24637C><font color=#dddee6><center>Incorrect Password</center></font>”;
}
?>
I just can’t seem to get it to work. the usernames and passwords are VARCHAR inside the database. not md5’d. think you could tell me why it wont work?
EDIT: I think the problem has something to do with how it is fetching the array.. =/