I want to make option to approve users before they can login or to ban them, here is code
MySQL Syntax (Toggle Plain Text)
<HTML><HEAD><TITLE>Fakultet informacionih tehnologija</TITLE> </HEAD>
<BODY TEXT="#ffffff" BACKGROUND="fakultet/Assets/bg.jpg" LINK="#FFFF00" VLINK="#CDCD00" BGCOLOR="#000000">
<CENTER><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="700">
<CENTER>
<FONT SIZE=+4 FACE="arial,helvetica">
Fakultet informacionih tehnologija
<HR>
</CENTER>
<?php
session_start();
// dBase file
include "dbConfig.php";
if ($_GET["op"] == "login")
{
if (!$_POST["username"] || !$_POST["password"])
{
header("Refresh: 3;login.php");
die("You need to provide a username and password.");
}
// CREATE query
$q = "SELECT * FROM `dbUsers` "
."WHERE `username`='".$_POST["username"]."' "
."AND `password`=PASSWORD('".$_POST["password"]."') "
."LIMIT 1";
// Run query
$r = mysql_query($q);
if ( $obj = @mysql_fetch_object($r) )
{
// Login good, CREATE session variables
$_SESSION["valid_id"] = $obj->id;
$_SESSION["valid_user"] = $_POST["username"];
$_SESSION["valid_time"] = TIME();
// Redirect to member page
Header("Location: index.php");
}
ELSE
{
// Login NOT successful
header('Refresh: 3;login.php');
die("Sorry, could not log you in. Wrong login information.");
}
}
ELSE
{
//If all went RIGHT the Web form appears AND users can LOG IN
echo "<form action=\"?op=login\" method=\"POST\">";
echo "Username: <input name=\"username\" size=\"15\"><br />";
echo "Password: <input type=\"password\" name=\"password\" size=\"16\"><br />";
echo "<input type=\"submit\" value=\"Login\"><br />";
echo "<a href=\"register.php\">Register</a>";
echo "</form>";
}
?>
<br><FONT SIZE=+3>Coded BY Filip ^_^</A></FONT>
</BODY></HTML>
and in sql dbusers I have tabs id,user,password,email,approved and banned. So what code I need to add into php to make check for approved/banned?