Warning: Supplied argument is not a valid MySQL result resource in /hsphere/local/home/twatters/gwatters.com/ta/Login Pages/Login.php on line 32
Warning: Cannot add header information - headers already sent by (output started at /hsphere/local/home/twatters/gwatters.com/ta/Login Pages/Login.php:9 in /hsphere/local/home/twatters/gwatters.com/ta/Login Pages/Login.php on line 36
Warning: Cannot add header information - headers already sent by (output started at /hsphere/local/home/twatters/gwatters.com/ta/Login Pages/Login.php:9) in /hsphere/local/home/twatters/gwatters.com/ta/Login Pages/Login.php on line 37
::
the code is:
Code: Select all
<?php
$Host = "******";
$User = "******";
$Pass = "******";
$DBName = "******";
$TableName = "******";
$Query = "SELECT * FROM $TableName WHERE Username = $Username";
$Link = mysql_connect("$Host", "$User", "$Pass");
mysql_select_db("$DBName");
if (!$_POSTї'Username']) {
echo ("Please fill out your username.<BR>");
}
if (!$_POSTї'Password']) {
echo ("Please fill out your password.<BR>");
}
If (mysql_connect("$Host", "$User", "$Pass")) {
print ("Yahoo!!!<BR>\n");
}
if ($Username && $Password) {
$res = mysql_query("SELECT Username,Password FROM $TableName WHERE Username='$Username' AND Password='$Password'");
$num = mysql_num_rows($res);
if ($num != '0') {
$verified_user = $Username;
$verified_userpw = $Password;
setcookie("Username", "$verified_user", time()+ "10000000");
setcookie("Password", "$verified_userpw", time()+ "10000000");
print ("You have sucessfully logged in.\n");
} else {
print ("Bad Username or Password.\n");
mysql_error();
}
}
mysql_close($Link);
?>This is going to hopefully be a user login system, but if any of you have ideas that would work better for this, that would be great.
Thanks,
CoW