I am really baffled by this problem. I have tried so many things to get
this working but to no avail. Here is the
actual code:
function verify_user($username, $password){
$conn = mysql_connect($db_host, $db_user, $db_pass) or
die("Error while connecting to Database System.");
$select_db = mysql_select_db($db_name) or
die("Error could not select the database");
$query = "SELECT FROM users WHERE username='$username'";
$result = mysql_query($query) or
die("Unable to get query");
$rows = mysql_fetch_array($result);
$password = md5($password);
if($rows["password"] == $password){
print "You have been verified as $username.<br>";
print "Registering your session.<br>";
}
else{
print "Error: Bad username or password.<br>";
print "Please go <a href=\"/?page=admin&step=1\">back</a>";
}
}
Anyways the problem is I cannot get it to even get to the database. It
works when I try to connect in the actual code before I call this function.
Like for example in index.php
$conn = mysql_connect($db_host, $db_user, $db_pass) or
die("Error while connecting to Database System.");
$select_db = mysql_select_db($db_name) or
die("Error could not select the database");
verify_user($username, $pass);
But when I do it that way it won't let me run a query right. I am so
baffled. Any input would be appreciated. Thanks.
-------------------------------------------------------------
Tj Corley
[EMAIL PROTECTED]
The Planet
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]