Since you seem to be the one with the brains, might as well call on you for a little more assistance. Everything works good on the code I have, except now I am getting the following error.
Warning: Cannot modify header information - headers already sent by (output started at /home/spytech/public_html/rodncustoms/login.phtml:19) in /home/spytech/public_html/rodncustoms/login.phtml on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/spytech/public_html/rodncustoms/login.phtml:19) in /home/spytech/public_html/rodncustoms/login.phtml on line 89
Now, here is the PHP for the login.phtml file.
<html>
<head>
<title>Rod N' Customs - System Development Stage</title>
</head>
<body bgcolor="#FFFFFF">
<font face="arial" size="3"><b>Rod N' Customs System Development Stage</b><br><br></font>
<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="32" bgcolor="#CDCDCD">
<tr>
<td>
<table border="0" cellpadding="4" cellspacing="1" width="100%" height="100%" bgcolor="#CDCDCD">
<tr>
<td width="100%" bgcolor="#EBEBEB" NOWRAP><font face="verdana" size="2"><?
// RETREIVE VARIABLES
include("/-var-/general.phtml");
if(empty($uid) && empty($upass)) {
echo "You are not logged in. Please <a href=\"$site_url/login.phtml\"><b>Login</b></a> or <a href=\"$site_url/registration/index.phtml\"><b>Register</b></a>.";
} else {
echo "Currently logged in as <b>$uid</b>. [<a href=\"$site_url/logout.phtml\"><b>Logout</b></a>]";
}
?></font></td>
</tr>
</table></td>
</tr>
</table></td>
<td>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#CDCDCD">
<tr>
<td>
<table border="0" cellpadding="4" cellspacing="1" width="100%" bgcolor="#CDCDCD">
<tr>
<td width="100%" bgcolor="#F5F5F5" NOWRAP><? include("/-tmpl-/nav.phtml"); ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table><br><br>
<?
// RETREIVE VARIABLES
include("/-var-/general.phtml");
include("/-var-/connect.phtml");
include("/-var-/db_t.phtml");
MYSQL_CONNECT($conhost,$conuser,$conpass);
if($function == "login") {
// OPEN DATABASE
$con_db_member = @mysql_select_db($db_member);
// SELECT LOGIN
$select_login = mysql_query("SELECT username, password FROM $t_member_general WHERE username = '$username' and password = '$password'");
if(!empty($uid) && !empty($upass)) {
$message = "You are already logged in.";
} else {
if(empty($username) or empty($password)) {
$message = "You need to put in a username and password.";
} else {
if(mysql_num_rows($select_login) == 1) {
setcookie("uid", mysql_result($select_login, 0, 0), time() + 15768000);
setcookie("upass", mysql_result($select_login, 0, 1), time() + 15768000);
$message = "You have been logged in. <a href=\"$site_url\">Return to Home Page</a>.";
} else {
$message = "You could not be logged in. You may have entered invalid information. <a href=\"$site_url/login/index.phtml\">Return to login</a>.";
}
}
}
echo "<font face=\"verdana\" size=\"2\">$message</font>";
} else {
echo "<form action=\"$site_url/login.phtml?function=login\" method=\"post\"><input type=\"text\" name=\"username\" size=\"15\">
<input type=\"password\" name=\"password\" size=\"15\">
<input type=\"submit\" name=\"submit\" value=\"Login\">
</form>";
}
?>
<br><br><div align="right"><font face="arial" size="2">All original content copyright (c) 2003, SpyTech Designs.</font></div>
</body>
</html>
And you can check it out by going to:
http://rodncustoms.spytechdesigns.com/login.phtml
user: bobd
pass:1234