J,
Thanks for the help. I did try what you suggested. here is my complete code.
//check for required fields from the form
if ((!$_POST[username]) || (!$_POST[user_password])) {
header("Location: listing23.7.php");
exit;
}
echo "1"
//connect to server and select database
$conn = mysql_connect("localhost", "XXXX", "XXXXXXX") or die(mysql_error());
mysql_select_db("db_new1",$conn) or die(mysql_error());
//create and issue the query
$sql = "select username, user_password from phpbb_users where username = '$_POST[username]' AND user_password = '$_POST[user_password]'";
$result = mysql_query($sql,$conn) or die(mysql_error());
//get the number of rows in the result set; should be 1 if a match
if (mysql_num_rows($result) == 1) {
//if authorized, get the values of username
$username = mysql_result($result, 0, 'username');
//set authorization cookie
setcookie("auth", "1", 0, "/", "goldcountrymini.com", 0);
//prepare message for printing, and user menu
$msg = "<P>$username is authorized!</p>";
$msg .= "<P>Authorized Users' Menu:";
$msg .= "<ul><li><a href=listing23.9.php>secret page</a></ul>";
} else {
//redirect back to login form if not authorized
header("Location: listing23.7.php");
exit;
}
?>
I took out the passwords of course, but they're correct. I am trying to reuse the exsisting database for my message board. Do you want to see my login script?