工会web
This commit is contained in:
39
GonghuiWeb/www/js/index.php
Normal file
39
GonghuiWeb/www/js/index.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
class CCheckCodeFile{
|
||||
private $mCheckCodeNum = 4;//验证码位数
|
||||
private $mCheckCode = '0123456789';//产生的验证码
|
||||
private $mCheckImageWidth = '65';//验证码的图片宽度
|
||||
private $mCheckImageHeight = '20';//验证码的图片宽度
|
||||
//输出验证码图片
|
||||
public function OutCheckImage(){
|
||||
header("Content-type:image/png");//输出图象头信息
|
||||
$im = imagecreate($this->mCheckImageWidth,$this->mCheckImageHeight);//建立图象
|
||||
$black = imagecolorallocate($im,255,255,255);//建立黑色标志符
|
||||
$white = imagecolorallocate($im,0,0,0);//建立白色标志符
|
||||
$gray = imagecolorallocate($im,100,100,100);//建立灰色标志符
|
||||
imagefill($im,80,30,$black);//填充图象
|
||||
for($i=0;$i<50;$i++){
|
||||
$randcolor=imagecolorallocate($im,rand(100,255),rand(100,255),rand(100,255));//建立一个随机图象颜色标志符
|
||||
imagesetpixel($im, rand(0,$this->mCheckImageWidth),rand(0,$this->mCheckImageHeight),$randcolor);//用上一行建立的标志符描点,点的坐标为随机
|
||||
}
|
||||
// for($i=0;$i<5;$i++){
|
||||
// imageline($im,rand(0,$this->mCheckImageWidth),rand(0,$this->mCheckImageHeight),rand(0,$this->mCheckImageWidth),rand(0,$this->mCheckImageHeight),$gray);//以随机坐标画线
|
||||
// }
|
||||
for($i=0;$i<=$this->mCheckCodeNum;$i++){
|
||||
$authnum.=substr($this->mCheckCode,rand(0,9),1);//建立验证字符串
|
||||
}
|
||||
$_SESSION['num']=strtolower($authnum);//把字符串写入SESSION以待验证
|
||||
$x=rand(2,20);
|
||||
$y=rand(2,6);
|
||||
imagestring($im,5,$x,$y,$authnum,$white);//把字符串写入图片
|
||||
imagepng($im);//输出图片
|
||||
imagedestroy($im);//注销图片资源
|
||||
}
|
||||
}
|
||||
session_start();
|
||||
if($_SESSION['num']){
|
||||
unset($_SESSION['num']);//注销上一次的图片验证码
|
||||
}
|
||||
$code_image = new CCheckCodeFile;
|
||||
$code_image ->OutCheckImage();
|
||||
?>
|
||||
4
GonghuiWeb/www/js/ip.php
Normal file
4
GonghuiWeb/www/js/ip.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
include_once("../../inc/ips.php");
|
||||
echo convertip("../../",$_GET[ip]);
|
||||
?>
|
||||
19
GonghuiWeb/www/js/login.php
Normal file
19
GonghuiWeb/www/js/login.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
session_start();
|
||||
include_once("../../inc/class.php");
|
||||
$db = new myConn;
|
||||
$GG=array_merge($db->getpost($_POST,"uname|user|3|16|1"),$GG);
|
||||
$upwd=md5($_POST[upwd]);//MD5加密
|
||||
if($GG['uname'] && $upwd){
|
||||
if($GG['uname'] == 'admin' && $upwd=='9a7d95c86e6da0fb3b47cd2384cfe27d'){
|
||||
//写入登录信息及SESSION
|
||||
$_SESSION['XQAdUser']='admin';
|
||||
echo "/adminxx";
|
||||
}else{
|
||||
echo "no";
|
||||
}
|
||||
}else{
|
||||
echo "no";
|
||||
}
|
||||
unset($GG,$db);
|
||||
?>
|
||||
34
GonghuiWeb/www/js/login2.php
Normal file
34
GonghuiWeb/www/js/login2.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
session_start();
|
||||
include_once("../../inc/class.php");
|
||||
$db = new myConn;
|
||||
$GG=array_merge($db->getpost($_POST,"uname|user|3|16|1"),$GG);
|
||||
$upwd=md5($_POST[upwd]);//MD5加密
|
||||
if($GG['uname'] && $upwd){
|
||||
$db->links();
|
||||
$row = $db->getdy("*",TABLE."adm","username='$GG[uname]' and userpass='$upwd'");
|
||||
if($row){
|
||||
$save=array(
|
||||
'timeone'=>time(),
|
||||
'timetwo'=>$row['timeone'],
|
||||
'timethree'=>$row['timetwo'],
|
||||
'ipone'=>$db->getip(),
|
||||
'iptwo'=>$row['ipone'],
|
||||
'ipthree'=>$row['iptwo']
|
||||
);
|
||||
//修改数据库
|
||||
$db->update(TABLE."adm",$save,"id='$row[id]'",1);
|
||||
//写入登录信息及SESSION
|
||||
$_SESSION['XQAdUser']=$row['username'];
|
||||
$_SESSION['XQAdPower']=$row['power'];
|
||||
$_SESSION['XQAdid']=$row['id'];
|
||||
echo "/admin";
|
||||
}else{
|
||||
echo "no";
|
||||
}
|
||||
$db->close();
|
||||
}else{
|
||||
echo "no";
|
||||
}
|
||||
unset($GG,$db);
|
||||
?>
|
||||
8
GonghuiWeb/www/js/number.php
Normal file
8
GonghuiWeb/www/js/number.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!empty($_SESSION['num']) and $_SESSION['num']==strtolower($_GET['number'])){
|
||||
echo 'success';
|
||||
}elseif (!strtolower(empty($_GET['number']))){
|
||||
echo "no";
|
||||
}
|
||||
?>
|
||||
17
GonghuiWeb/www/js/username.php
Normal file
17
GonghuiWeb/www/js/username.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include_once("../../inc/admin.inc.php");
|
||||
include_once("../../inc/class.php");
|
||||
$db = new myConn;
|
||||
$db->links();
|
||||
$GG=$db->getpost($GG,"username|user");
|
||||
if($GG['username']){
|
||||
$data=$db->getdy("names,province,school",TABLE."member","username='".$GG['username']."'");
|
||||
if($data){
|
||||
echo "姓名:<font color=#666666>".$data['names']."</font> 省份:<font color=#666666>".$data['province']."</font> 学校:<font color=#666666>".$data['school']."</font>";
|
||||
}else{
|
||||
echo "<font color=red>未检测到用户名</font>";
|
||||
}
|
||||
}
|
||||
$db->close();
|
||||
unset($GG,$db);
|
||||
?>
|
||||
Reference in New Issue
Block a user