- 积分
- 6
- 威望
-
- 金钱
-
- 注册时间
- 2011-2-24
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2011-2-26 01:49:37
|
显示全部楼层
这是我的index.php代码:
<?php
require_once 'conjunction.php';
require_once 'config.php';
if (ka_config("opwww")==1){
echo "<script>alert('对不起,系统维护中!');top.location.href='op.php';</script>";
exit;}
$name = NULL;
$i = 0;
for ( ; $i < 1; ++$i )
{
$j = 0;
for ( ; $j < 4; ++$j )
{
srand( ( double )microtime( ) * 1000000 );
$randname = rand( !$j ? 1 : 0, 9 );
$name .= $randname;
}
}
session_start( );
$_SESSION['yzcode'] = $name;
//前台登陆验证
if (submitcheck('islogin') == 'yes' && empty($admin_info2)) {
$user = addslashes(trim($user));
$pass = trim($pass);
$ycode=$_POST['ycode'];
$code=$_POST['code'];
if(empty($user) || empty($pass) || empty($code)){
echo "<script>alert('用户名或密码不能为空,请反回重新输入!');window.history.go(-1);</script>";
exit;
}
if($ycode!=$code){
echo "<script>alert('对不起,输入验证码有错!');window.history.go(-1);</script>";
exit;
}
$pass = md5($pass);
$ip=$_SERVER["REMOTE_ADDR"];
$resultb2=mysql_query("select * from tj where username='$user' and ip= '".$ip."'");
$rowb2=mysql_fetch_array($resultb2);
if ($rowb2!=""){
mysql_query("Delete from tj where username='$user' and ip='".$ip."'");
$exe=mysql_query($sql) or die("数据库修改出错");
}
$result=mysql_query("select * from ka_mem where kauser='$user' and kapassword='$pass'");
$row=mysql_fetch_array($result);
$pass1=$row['kapassword'];
if ($pass1!=$pass ){
echo "<script>alert('您输入的帐号或密码错误,请重新输入!');window.history.go(-1);</script>";
exit;
}
$resultb=mysql_query("select * from tj where username='$user' ");
$rowb=mysql_fetch_array($resultb);
if ($rowb!=""){
echo "<script>alert('对不起,该账号已登录过,请稍候重试!');window.history.go(-1);</script>";
exit;
}
$text=date("Y-m-d H:i:s");
$sql="update ka_mem set slogin='".$row['slogin']."',sip='".$row['sip']."',zlogin='".$text."',zip='".$ip."',look=look+1 where kauser='".$user."'";
$exe=mysql_query($sql) or die ($sql);
$_SESSION['username']= $user;
$sql="INSERT INTO tj set addate='".$text."',adddate='".$text."',username='".$user."',zt='1',ip='".$ip."'";
$exe=mysql_query($sql) or die("数据库修改出错");
if($row['look']<=0){
echo "<script>alert('第一次登陆,请重新设置密码!');top.location.href='?do=pass_huiyuan_f1';</script>";
exit;
}
if ($row['stat']==1){
echo "<script>alert('对不起,该用户已被禁止!');top.location.href='?do=logout';</script>";
exit;}
echo "<meta http-equiv=refresh content=\"0;URL=\">";exit;
}
?>
<HTML>
<HEAD>
<title><?=ka_config(1)?>-<?=ka_config(2)?></title>
<body oncontextmenu="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #FFFFFF;
}
.dndn {
BORDER-RIGHT: #d6d3ce 0px outset; BORDER-TOP: #d6d3ce 0px outset; FONT-SIZE: 9pt; BACKGROUND: #d6d3ce; BORDER-LEFT: #d6d3ce 0px outset; BORDER-BOTTOM: #d6d3ce 0px outset
}
body,td,th {
font-size: 12px;
color: #333333;
}
.b-03 {FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #040177; FONT-STYLE: normal; FONT-FAMILY: "细明体", "新细明体"
}
.b-04 {FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #ffffff; FONT-STYLE: normal; FONT-FAMILY: "细明体", "新细明体"
}
.style2 {FONT-SIZE: 12px; FONT-STYLE: normal; FONT-FAMILY: "细明体", "新细明体"
}
.style3 {COLOR: #000000
}
-->
</style>
<?
//已登陆
if($_SESSION['username']){
if (in_array($do, array('left','t', 'logout', 'top','kaijiangjieguo','l','list','h','k_tm','n1','k_tansave','ds','k_zt','k_zm','k_wx','k_ws','k_bb','k_sx','guiju','k_sxp','k_sx4','k_sx5','k_sx6','k_gg','k_lm','n2','k_tansx','k_ggsave','server','k_tangg','k_lm','k_lmsave','k_tanlm','kq','serverf','n55','n5','rake_bb','rake_ws','look','pz_tm','server_tm','pz_zm','server_zm','pz_zt','server_zt','pz_zm6','server_zm6','pz_sx','server_sx','pz_dd','server_dd','pz_lm','server_lm','pz_bb','server_bb','pz_ws','server_ws','pz_gg','server_gg','x1','x2','x3','x4','x5','re_pb','re_all','re_guan','re_zong','re_dai','re_mem','ka_del','ka_xxx','kawin','xt_abcd','xt_stds','xt_ds','kaijiangriqi','xt_copy','xt_bak','pz_wx','server_wx','huiyuanzixun','ziedit','k_sx2','k_sx3','k_zm6','pass_huiyuan','k_wb','n9','k_tann9','k_sxl','n6','pass_huiyuan_f1','k_tansxl','k_wsl','n7','spjieguo','k_tanwsl','k_sb','n8','k_tann8'))) {
if ($do!="logout" and $do!="t" ){
require_once 'login.php';}
require_once $do .'.php';
exit;
}
?>
<body scroll="no" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" border="0" cellpadding="0" height="100%">
<tr>
<td valign="top" height="66px">
<iframe id=frmRight style="Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; HEIGHT: 66" name=right src="?do=t" frameborder=0></iframe>
</td></tr><tr><td valign="top">
<table id=tblTotal height="100%" cellspacing=0 cellpadding=0 width="100%" border=0 name="tblTotal">
<tbody> <tr><td id=frmMenu valign=center noWrap align=middle name="frmMenu">
<iframe id=k_meml style="Z-INDEX: 2; VISIBILITY: inherit; WIDTH: 215px; HEIGHT: 100%" name=k_meml src="?do=left" frameborder=0 ></iframe>
</td><td width="100%" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
<tr><td height="100%" valign="top">
<iframe id=k_memr style="Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; HEIGHT: 100%" name=k_memr src="?do=guiju" frameborder=0></iframe>
</td>
</tr>
</table> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</table>
<?php
}
else {
?>
</HEAD>
<body scroll=no>
<SCRIPT language=JavaScript>
function CheckForm()
{
if(document.form1.user.value=="")
{
alert("请输入用户");
return false;
}
if(document.form1.pass.value=="")
{
alert("请输入密码");
return false;
}
if(document.form1.code.value=="")
{
alert("请输入以验证码");
return false;
}
return true;
}
</SCRIPT>
<?php
require_once 'ss.php';
}
?> |
|