i am haveing trouble codeing the login for the disable login i have coded the sql admincp an admin proc but have problem with the login.php if i use the codeing it shows the link blank
put this in admin cp
and in adminproc.php put this code
and in login.php put this code
and the sql for it
make a new row in ibwf_users
put this in admin cp
PHP Code:
//////////////////
else if($action=="chubi")
{
echo "<card id=\"main\" title=\"Admin CP\">";
$who = $_GET["who"];
$sid = $_GET["sid"];
$unick = getnick_uid($who);
$uid = getuid_sid($sid);
echo "<onevent type=\"onenterforward\">";
$avat = getavatar($who);
$email = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id='".$who."'"));
$site = mysql_fetch_array(mysql_query("SELECT site FROM ibwf_users WHERE id='".$who."'"));
$bdy = mysql_fetch_array(mysql_query("SELECT birthday FROM ibwf_users WHERE id='".$who."'"));
$uloc = mysql_fetch_array(mysql_query("SELECT location FROM ibwf_users WHERE id='".$who."'"));
$usig = mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id='".$who."'"));
$sx = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
$login = mysql_fetch_array(mysql_query("SELECT login FROM ibwf_users WHERE id='".$who."'"));
$perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));
$specialid = mysql_fetch_array(mysql_query("SELECT specialid FROM ibwf_users WHERE id='".$who."'"));
echo "<refresh>
<setvar name=\"unick\" value=\"$unick\"/>
<setvar name=\"savat\" value=\"$avat\"/>
<setvar name=\"semail\" value=\"$email[0]\"/>
<setvar name=\"usite\" value=\"$site[0]\"/>
<setvar name=\"ubday\" value=\"$bdy[0]\"/>
<setvar name=\"uloc\" value=\"$uloc[0]\"/>
<setvar name=\"usig\" value=\"$usig[0]\"/>
<setvar name=\"sx\" value=\"$sx[0]\"/>
<setvar name=\"perm\" value=\"$perm[0]\"/>
<setvar name=\"login\" value=\"$login[0]\"/>
<setvar name=\"npwd\" value=\"\"/>
";
echo "</refresh></onevent>";
echo "<p>";
echo "Nickname: <input name=\"unick\" maxlength=\"15\"/><br/>";
echo "Avatar: <input name=\"savat\" maxlength=\"100\"/><br/>";
echo "E-Mail: <input name=\"semail\" maxlength=\"100\"/><br/>";
echo "Site: <input name=\"usite\" maxlength=\"100\"/><br/>";
echo "Birthday<small>(YYYY-MM-DD)</small>: <input name=\"ubday\" maxlength=\"50\"/><br/>";
echo "Location: <input name=\"uloc\" maxlength=\"50\"/><br/>";
echo "Signature: <input name=\"usig\" maxlength=\"100\"/><br/>";
echo "Sex: <select name=\"usex\" value=\"$sx[0]\">";
echo "<option value=\"M\">Male</option>";
echo "<option value=\"F\">Female</option>";
echo "</select><br/>";
echo "Privileges: <select name=\"perm\" value=\"$perm[0]\">";
echo "<option value=\"0\">Normal</option>";
echo "<option value=\"1\">Moderator</option>";
echo "<option value=\"2\">Admin</option>";
if($uid==1) {
echo "<option value=\"3\">Owner</option>";
}
echo "</select><br/>";
echo "Login Menu: <select name=\"login\" value=\"$login[0]\">";
echo "<option value=\"1\">Enable</option>";
echo "<option value=\"2\">Disable</option>";
echo "</select><br/>";
echo "VIP: <select name=\"specialid\" value=\"$specialid[0]\">";
echo "<option value=\"0\">Normal</option>";
echo "<option value=\"1\">Millionaire</option>";
echo "<option value=\"2\">Fimi Masters</option>";
echo "<option value=\"8\">Fimi Marines</option>";
echo "<option value=\"9\">Fimi Sniper</option>";
echo "</select><br/>";
echo "<anchor>Update";
echo "<go href=\"admproc.php?action=uprof&sid=$sid&who=$who\" method=\"post\">";
echo "<postfield name=\"unick\" value=\"$(unick)\"/>";
echo "<postfield name=\"savat\" value=\"$(savat)\"/>";
echo "<postfield name=\"semail\" value=\"$(semail)\"/>";
echo "<postfield name=\"usite\" value=\"$(usite)\"/>";
echo "<postfield name=\"ubday\" value=\"$(ubday)\"/>";
echo "<postfield name=\"uloc\" value=\"$(uloc)\"/>";
echo "<postfield name=\"usig\" value=\"$(usig)\"/>";
echo "<postfield name=\"usex\" value=\"$(usex)\"/>";
echo "<postfield name=\"perm\" value=\"$(perm)\"/>";
echo "<postfield name=\"login\" value=\"$(login)\"/>";
echo "<postfield name=\"specialid\" value=\"$(specialid)\"/>";
echo "</go></anchor>";
echo "<br/><br/>";
echo "Password: <input name=\"npwd\" format=\"*x\" maxlength=\"15\"/><br/>";
echo "<anchor>Change";
echo "<go href=\"admproc.php?action=upwd&sid=$sid&who=$who\" method=\"post\">";
echo "<postfield name=\"npwd\" value=\"$(npwd)\"/>";
echo "</go></anchor>";
echo "</p>";
echo "<p align=\"center\">";
echo "<a href=\"admincp.php?action=chuinfo&sid=$sid\">";
echo "Users Info</a><br/>";
echo "<a href=\"index.php?action=admincp&sid=$sid\"><img src=\"http://coding-talk.com/images/admn.gif\" alt=\"*\"/>";
echo "Admin CP</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else{
echo "<card id=\"main\" title=\"Admin CP\">";
echo "<p align=\"center\">";
echo "I don't know how did you get into here, but there's nothing to show<br/><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
PHP Code:
else if($action=="uprof")
{
$who = $_GET["who"];
$unick = $_POST["unick"];
$perm = $_POST["perm"];
$savat = $_POST["savat"];
$semail = $_POST["semail"];
$usite = $_POST["usite"];
$ubday = $_POST["ubday"];
$uloc = $_POST["uloc"];
$usig = $_POST["usig"];
$usex = $_POST["usex"];
$login = $_POST["login"];
$specialid = $_POST["specialid"];
echo "<card id=\"main\" title=\"fimiwap\">";
echo "<p align=\"center\">";
$onk = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$who."'"));
$exs = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$unick."'"));
if($onk[0]!=$unick)
{
if($exs[0]>0)
{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/>New nickname already exist, choose another one<br/>";
}else
{
$res = mysql_query("UPDATE ibwf_users SET avatar='".$savat."', email='".$semail."', site='".$usite."', birthday='".$ubday."', location='".$uloc."', signature='".$usig."', sex='".$usex."', login='".$login."', name='".$unick."', perm='".$perm."', specialid='".$specialid."' WHERE id='".$who."'");
if($res)
{
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"o\"/>$unick's profile was updated successfully<br/>";
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/>Error updating $unick's profile<br/>";
}
}
}else
{
$res = mysql_query("UPDATE ibwf_users SET avatar='".$savat."', email='".$semail."', site='".$usite."', birthday='".$ubday."', location='".$uloc."', signature='".$usig."', sex='".$usex."', login='".$login."', name='".$unick."', perm='".$perm."', specialid='".$specialid."' WHERE id='".$who."'");
if($res)
{
echo "<img src=\"http://coding-talk.com/images/ok.gif\" alt=\"o\"/>$unick's profile was updated successfully<br/>";
}else{
echo "<img src=\"http://coding-talk.com/images/notok.gif\" alt=\"x\"/>Error updating $unick's profile<br/>";
}
}
echo "<br/><a href=\"admincp.php?action=chuinfo&sid=$sid\">";
echo "Users Info</a><br/>";
echo "<a href=\"index.php?action=admincp&sid=$sid\"><img src=\"http://coding-talk.com/images/admn.gif\" alt=\"*\"/>";
echo "Admin CP</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p></card>";
}
////
PHP Code:
///////
$login = mysql_fetch_array(mysql_query("SELECT login FROM ibwf_users WHERE id='".$who."'"));
if($login==1)
{
//this is were i put the site login link//
}else if($login[0]=='2'){
echo "$uid your login has been disabled by a staff member<br/>";
echo "if this is a error contact a admin/owner<br/>";
}
make a new row in ibwf_users
Code:
call it login set it a char(1) Not Null and Default 1
Comment