Thread: requesting help.
View Single Post
  #4  
Old 2 Weeks Ago
arenlor arenlor is offline
Senior Member
 
Join Date: Aug 2006
Location: Jaa, kore da.
Posts: 108
Send a message via ICQ to arenlor Send a message via AIM to arenlor Send a message via MSN to arenlor Send a message via Yahoo to arenlor
Default

Just to answer the question, make a mysql database (or use an existing one) and put a table in it that has username and password.

the code is
$conn = mysql_connect('mysql','username','password');
$db = mysql_select_db('databasename');
$username = $_POST['username'];
$password = $_POST['password'];
if($password != '' && $username != '')
{
$query = "select * from TABLENAME where username = '$username' and password = '$password'";
$result = mysql_query("$query");
$num = mysql_num_rows("$result");
if($num == 1)
{
whatever you want it to do such as header("location:file");
}
}
else
{
echo "




";
}
?>

note where I put text|password you need to choose one.
__________________
FAQ
Reply With Quote