Can anyone tell me why the following setcookie()s fail?


if (!($link = mysql_connect($dbhost, $dbuser, $dbpass))) {
ReportError("An error was encountered while trying to establish a connection
to the mySQL server, using function mysql_connect(), with..\r\n Hostname:
$dbhost \n Username: $dbuser \n Password: $dbpass \r\n A possible problem is
that the hostname/username/password is incorrect, or the mySQL server is
if (!(mysql_select_db($dbname, $link))) {
ReportError("An error was encountered while trying to select the mySQL
database '$dbname', using funcion mysql_select_db().\r\nA possible problem
is that the specified database '$dbname' does not exist.");
$find_user = mysql_query("SELECT `user_id` FROM `users` WHERE `name` =
'$username' AND `password` = '$password'");
if (mysql_num_rows($find_user) == 1) {
$title = "Hello, $username!";
$message = "Thanks for logging in! You can now use our forums, add comments
and add Tabs/Lyrics.";
$uid = mysql_fetch_row($find_user);
$expDate = mktime(12, 50, 30, 6, 20, 2010);
setcookie("tzusercookie", $uid, $expDate);
setcookie("tzpasscookie", $password, $expDate);
} else {
$title = "There was an error logging you in";
$message = "Could not log you in, check the username and password you
entered and try again.";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<?php include("templates/$template/styles.css"); ?>
<title><?php echo($title); ?> -</title>
<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<?php include("templates/$template/head.php"); ?>
<table width="100%" cellspacing="0" cellpadding="0" bgcolor="white"
<tr><td width="20%" valign="top"><?php include("lnav.php"); ?></td><td
<table width="95%" align="center" bgcolor="#CFCFCF"
height="30"><tr><td><b><?php echo($title); ?></b></td></tr></table>
<table width="95%" cellspacing="0" cellpadding="1" border="0"
<?php echo($message); ?>

<td width="20%" valign="top"><?php include("rnav.php"); ?></td></tr></table>
<?php include("footer.php"); ?>


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to