SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: setCookie parse error
Threaded View
-
Jul 29, 2000, 16:11 #1
- Join Date
- Jan 2000
- Posts
- 37
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm trying to set a cookie after a user logs in. The login form brings the user to this page where I set the cookie, but it keeps giving me a parse error on the setCookie line. Here's the code, could someone explain to me what I'm doing wrong?
<?php
#Connect to database here
$expire = time() + (3600 * 24 * 180);
$path = "/";
$domain = ".mydomain.com";
$query = "SELECT USERNAME, PASSWORD FROM MEMBERS";
$query .= " WHERE USERNAME = '$USER' AND";
$query .= " PASSWORD = '$PWORD';
$user_result = mysql_query($query);
$num_users = mysql_num_rows($user_result);
$memb = 12345;
if ($num_users == 0)) {
echo 'Authorization Required!\n';
echo 'Hit reload to try again.';
exit;
} else {
setcookie ("id", $memb, $expire, $path, $domain, 0);
}
?>
thanks in advance,
kankohi
Bookmarks