ok this is some code i pick out i'm a noob so i don't know if its the right material
Took this chunk from my function.php
// This Function authenticates to make sure that the user has entered a valid
// username and password, and then grabs the user's info
function authenticate($user, $pass, $minRank) {
global $fontString;
global $myrow;
global $recruit;
$result = @mysql_query("SELECT * FROM members WHERE username = \"$user\"");
$myrow = mysql_fetch_array($result);
if($myrow != NULL)
extract($myrow);
// If the username matches the result in the mysql query and the password is correct
// return the rank of the user.
if($user == $username && $pass == $password and $username != NULL) {
if($disable != 1) {
if($rank >= $minRank) {
return 1;
}
else {
echo("
$fontString
You are not high enough rank. <center><br><font size=2 face=verdana><b><a href=main.php>Click Here to return to console</font></b></center>
");
}
}
if($disable == 1) {
$result = @mysql_query("SELECT * FROM members WHERE username = \"$user\"");
$row = mysql_fetch_array($result);
extract($row);
echo("
$fontString
You have been disabled.<br><br>
<font color=#1C86EE size=1 face=verdana>$disabled</font>
");
}
}
else {
if(!$user) {
echo("
$fontString
<b><font color=red>Invalid Username or Password</font></b><br><br>
<font color=red>Note:</font> Username and Password are CaSe Sensitive. <br>
If you are unsure of how your name is spelled you should check the members page.<br>
If you had forgotten your password ask one of the generals to retrieve it for you<p>
<form action=main.php method=post>
<FONT color=#76A5D5 size=2>
<b>Username:<b> <INPUT style=\"border:1px solid #76A5D5; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #ffffff\" type=username name=username size=\"20\"><br>
<b>Password:</b> <INPUT style=\"border:1px solid #76A5D5; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #ffffff\" type=password name=password size=\"20\"><br><br>
<INPUT style=\"border:1px solid #1874CD; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #76A5D5; float:center\" type=submit value=Login>
");
}
else {
echo("
$fontString
<b><font color=red>Invalid Username or Password</font></b><br><br>
<font color=red>Note:</font> Username and Password are CaSe Sensitive. <br>
If you are unsure of how your name is spelled you should check the members page.<br>
If you had forgotten your password ask one of the generals to retrieve it for you
<p>
<form action=main.php method=post>
<FONT color=#76A5D5 size=2>
<b>Username:<b> <INPUT style=\"border:1px solid #76A5D5; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #ffffff\" type=username name=username size=\"20\"><br>
<b>Password:</b> <INPUT style=\"border:1px solid #76A5D5; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #ffffff\" type=password name=password size=\"20\"><br><br>
<INPUT style=\"border:1px solid #1874CD; WIDTH: 115px; HEIGHT: 20px; BACKGROUND-COLOR: #76A5D5; float:center\" type=submit value=Login>
");
}
}
}
This is my main.php
<?php
if(!$username) {
$username = $usercook;
$password = $passcook;
}
setcookie("usercook", "$username");
setcookie("passcook", "$password");
require("functions.php");
global $myrow;
if(authenticate($username, $password, 0) == 1) {
onLogin();
displayProf($username, $REMOTE_ADDR);
dispConsole($myrow["rank"], $myrow["recruit"]);
echo("
<br><center$fontString<font size=5 face=verdana><b>Internal News</b></a>
");
dispNews(1, 10);
}
include("footer.php");
?>
is anything else needed? oonce again let me know