php 文件安装三

php 文件安装三

总共需多个页面,register.php 和 verify.php

?php///////////////////////////////////////////////////////////////////////////////
Mini同学录 (_class卡塔尔//// (cState of QatarPiscDong studio (State of Qatar////
程序完全免费,请保留这段代码。//
请勿出卖本程序或其改良版,请勿利用本程序或其修改版实行任何商业活动。/////////////////////////////////////////////////////////////////////////////

  1. 客商注册表格 register.php

require_once(‘inc.php’);if(!file_exists($l_file)){echo
getstop(2);if($_SERVER[‘REQUEST_METHOD’]==’POST’
$_POST[‘title’]!=” $_POST[‘username’]!=” $_POST[‘name’]!=”
$_POST[‘password’]!=”){require_once($c_file);echo ‘div
class=title安装MySQL数据库/divdiv class=gcontentul’;$query=create table
{$dbprefix}main (id int(10) NOT NULL auto_increment,title varchar(255)
NOT NULL,school varchar(255) default NULL,classname varchar(255) default
NULL,open int(5) NOT NULL default ‘0’,openreg int(5) NOT NULL default
‘0’,gid varchar(255) default ‘1|2|3’,content text,email int(5) NOT NULL
default ‘0’,pagesize int(10) NOT NULL default ’20’,upload int(5) NOT
NULL default ‘0’,maxsize int(10) NOT NULL default ‘0’,filetype
varchar(255) default ‘jpg’,thum int(5) NOT NULL default ‘0’,slink int(5)
NOT NULL default ‘0’,veri int(5) NOT NULL default ‘0’,icp varchar(255)
default NULL,skin int(10) NOT NULL default ‘0’,timefix varchar(255) NOT
NULL default ‘0’,ip varchar(255) default NULL,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($queryState of Qatar;echo
‘li创建数量表 ‘.$dbprefix.’main:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

复制代码 代码如下:
 

$query=create table {$dbprefix}member (id int(10) NOT NULL
auto_increment,username varchar(255) NOT NULL,password varchar(255) NOT
NULL,name varchar(255) NOT NULL,status int(5) NOT NULL default ‘0’,power
int(5) NOT NULL default ‘0’,regdate int(15) NOT NULL default ‘0’,visit
int(10) NOT NULL default ‘0’,visitdate int(15) NOT NULL default
‘0’,question varchar(255) default NULL,answer varchar(255) default
NULL,email varchar(255) default NULL,gender int(5) NOT NULL default
‘0’,bir_y int(4) NOT NULL default ‘0’,bir_m int(2) NOT NULL default
‘0’,bir_d int(2) NOT NULL default ‘0’,address varchar(255) default
NULL,location varchar(255) default NULL,url varchar(255) default
NULL,work varchar(255) default NULL,phone varchar(255) default NULL,tel
varchar(255) default NULL,qq varchar(255) default NULL,msn varchar(255)
default NULL,gtalk varchar(255) default NULL,gid int(5) NOT NULL default
‘0’,rela varchar(255) default NULL,photo varchar(255) default
NULL,pupload int(5) NOT NULL default ‘0’,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔国;echo
‘li创设数量表 ‘.$dbprefix.’member:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

 

$query=create table {$dbprefix}online (aid int(10) NOT NULL default
‘0’,datetime int(15) NOT NULL default ‘0’,online int(5) NOT NULL default
‘1’,ip char(15) default NULL,UNIQUE KEY aid (aid))
.(chksqlv()?’ENGINE=MEMORY DEFAULT
CHARSET=gb2312′:’type=HEAP’);$result=mysql_澳门新葡亰平台游戏网站 ,query($query卡塔尔国;echo
‘li创立数量表 ‘.$dbprefix.’online:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

  

$query=create table {$dbprefix}topic (id int(10) NOT NULL
auto_increment,content text NOT NULL,aid int(10) NOT NULL default
‘0’,datetime int(15) NOT NULL default ‘0’,sticky int(5) NOT NULL default
‘0’,sid int(10) NOT NULL default ‘0’,tid int(5) NOT NULL default ‘0’,mid
int(5) NOT NULL default ‘0’,disp int(5) NOT NULL default ‘0’,`lock`
int(5) NOT NULL default ‘0’,rid int(10) NOT NULL default ‘0’,lasttime
int(15) NOT NULL default ‘0’,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔国;echo
‘li建设布局数量表 ‘.$dbprefix.’topic:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

      用户名:

$query=create table {$dbprefix}vote (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,tid int(10) NOT NULL
default ‘0’,vid int(10) NOT NULL default ‘0’,datetime int(15) NOT NULL
default ‘0’,UNIQUE KEY id (id)) .(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($queryState of Qatar;echo
‘li构建数量表 ‘.$dbprefix.’vote:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

      密码:

$query=create table {$dbprefix}photo (id int(10) NOT NULL
auto_increment,url text NOT NULL,title varchar(255) default NULL,aid
int(10) NOT NULL default ‘0’,cid int(10) NOT NULL default ‘0’,datetime
int(15) NOT NULL default ‘0’,upload int(5) NOT NULL default ‘0’,disp
int(5) NOT NULL default ‘0’,vid int(5) NOT NULL default ‘0’,UNIQUE KEY
id (id)) .(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔国;echo
‘li建设布局数量表 ‘.$dbprefix.’photo:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

      电子邮件:

$query=create table {$dbprefix}pcomment (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,pid int(10) NOT NULL
default ‘0’,disp int(5) NOT NULL default ‘0’,datetime int(15) NOT NULL
default ‘0’,content text NOT NULL,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔;echo
‘li创设数量表 ‘.$dbprefix.’pcomment:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

     

$query=create table {$dbprefix}camp (id int(10) NOT NULL
auto_increment,title varchar(255) NOT NULL,aid int(10) NOT NULL default
‘0’,sticky int(5) NOT NULL default ‘0’,closed int(5) NOT NULL default
‘0’,disp int(5) NOT NULL default ‘0’,datetime int(15) NOT NULL default
‘0’,cdate varchar(255) default NULL,cloc varchar(255) default NULL,cpay
varchar(255) default NULL,content text,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($queryState of Qatar;echo
‘li创建数量表 ‘.$dbprefix.’camp:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

  

$query=create table {$dbprefix}ccomment (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,cid int(10) NOT NULL
default ‘0’,sid int(10) NOT NULL default ‘0’,disp int(5) NOT NULL
default ‘0’,datetime int(15) NOT NULL default ‘0’,content text,UNIQUE
KEY id (id)) .(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔;echo
‘li建设布局数量表 ‘.$dbprefix.’ccomment:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

 

$query=create table {$dbprefix}cuser (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,cid int(10) NOT NULL
default ‘0’,tid int(10) NOT NULL default ‘1’,datetime int(15) NOT NULL
default ‘0’,UNIQUE KEY id (id)) .(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔(قطر‎;echo
‘li构建数量表 ‘.$dbprefix.’cuser:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

 

$query=create table {$dbprefix}message (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,tid int(10) NOT NULL
default ‘0’,datetime int(15) NOT NULL default ‘0’,readed int(5) NOT NULL
default ‘0’,content text NOT NULL,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($queryState of Qatar;echo
‘li创立数量表 ‘.$dbprefix.’message:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

  1. 创制客户数据表格 Users
    复制代码 代码如下:
     CREATE TABLE IF NOT EXISTS `users` (

$query=create table {$dbprefix}adminop (id int(10) NOT NULL
auto_increment,aid int(10) NOT NULL default ‘0’,sid int(10) NOT NULL
default ‘0’,tid int(5) NOT NULL default ‘0’,datetime int(15) NOT NULL
default ‘0’,content text NOT NULL,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔;echo
‘li建设构造数量表 ‘.$dbprefix.’adminop:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

   `id` int(11) NOT NULL auto_increment,

$query=create table {$dbprefix}link (id int(10) NOT NULL
auto_increment,title varchar(255) NOT NULL,url varchar(255) NOT
NULL,thread int(10) NOT NULL default ‘0’,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔国;echo
‘li创设数量表 ‘.$dbprefix.’link:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

   `status` varchar(20) NOT NULL,

$query=create table {$dbprefix}skin (id int(10) NOT NULL
auto_increment,path varchar(255) NOT NULL,title varchar(255) default
NULL,sfile varchar(255) NOT NULL,UNIQUE KEY id (id))
.(chksqlv()?’ENGINE=MyISAM DEFAULT
CHARSET=gb2312′:’type=MyISAM’);$result=mysql_query($query卡塔尔(قطر‎;echo
‘li建构数量表 ‘.$dbprefix.’skin:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

   `username` varchar(20) NOT NULL,

$title=htmlspecialchars(trim($_POST[‘title’]),ENT_QUOTES);$query=sprintf(‘insert
into %s (title) values (%s)’, $dbprefix.’main’,SQLString($title,
‘text’));$result=mysql_query($query卡塔尔;echo ‘li写入新数据
‘.$dbprefix.’main:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

   `password` varchar(20) NOT NULL,

$username=trim($_POST[‘username’]);$password=enc_p(trim($_POST[‘password’]));$name=htmlspecialchars(trim($_POST[‘name’]),ENT_QUOTES);$query=sprintf(‘insert
into %s (username, password, name, power, regdate) values (%s, %s, %s,
9, %s)’, $dbprefix.’member’,SQLString($username,
‘text’),SQLString($password, ‘text’),SQLString($name,
‘text’),time());$result=mysql_query($query卡塔尔国;echo ‘li写入新数据
‘.$dbprefix.’member:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);

   `email` varchar(20) NOT NULL,

$query=sprintf(‘insert into %s (path, title, sfile卡塔尔 values (%s, %s,
%s卡塔尔’, $dbprefix.’skin’,SQLString(‘blue’, ‘text’卡塔尔,SQLString(‘浅深橙梦想’,
‘text’卡塔尔(قطر‎,SQLString(‘styles.css’,
‘text’卡塔尔卡塔尔;$result=mysql_query($query卡塔尔国;echo ‘li写入新数据
‘.$dbprefix.’skin:span
style=font-weight:bold;color:#’.($result==true?’036;成功’:’f00;失败’).’/span/li’;unset($query);unset($result);echo
‘/ulinput type=button value=完成 class=button
onclick=location.href=’../’;//div’;writeText($l_file,time(State of Qatar卡塔尔(قطر‎;}else{?div
class=title第2步:配置消息/divdiv class=lcontentform method=post
onsubmit=if(document.form1.title.value==” ||
document.form1.username.value==” || document.form1.password.value==”
|| document.form1.name.value==”卡塔尔国{alert(‘请输入配置消息。’卡塔尔(قطر‎;return
false;}else if(document.form1.password.value!=”
document.form1.password.value!=document.form1.password2.value卡塔尔{alert(‘请确认密码。’State of Qatar;return
false;} name=form1div class=formlinelabel for=formtitle标题:/labelinput name=title id=formtitle size=32//divdiv
class=formline大班消息/divdiv class=formlinelabel
for=formusername客商名:/labelinput name=username id=formusername
size=32//divdiv class=formlinelabel for=formname姓 名:/labelinput
name=name id=formname size=32//divdiv class=formlinelabel
for=formpassword密 码:/labelinput type=password name=password
id=formpassword size=32//divdiv class=formlinelabel for=formpassword2确
认:/labelinput type=password name=password2 id=formpassword2
size=32//divdiv class=formlineinput type=submit value=下一步
id=formsubmit class=button / input type=reset value=重新初始化 class=button
//div/form/div?php}echo getsfoot(State of Qatar;}else{header(‘Location:../’卡塔尔(قطر‎;}?

   `activationkey` varchar(100) NOT NULL,

   PRIMARY KEY  (`id`),

   UNIQUE KEY `username` (`username`),

   UNIQUE KEY `email` (`email`),

   UNIQUE KEY `activationkey` (`activationkey`)

 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

  1. 创设验证码 客户注册新闻存入数据表
    我们利用情况‘verify’ 来代表还未有激活的客商。

复制代码 代码如下:
 $activationKey =  mt_rand() . mt_rand() . mt_rand() . mt_rand() .
mt_rand();

 $username = mysql_real_escape_string($_POST[username]);

 $password = mysql_real_escape_string($_POST[password]);

 $email = mysql_real_escape_string($_POST[email]);  

 $sql=”INSERT INTO users (username, password, email, activationkey,
status) VALUES (‘$username’, ‘$password’, ‘$email’, ‘$activationKey’,
‘verify’)”;

  1. 发送验证码
    复制代码 代码如下:
     echo “An email has been sent to $_POST[email] with an activation
    key. Please check your mail to complete registration.”;

 ##Send activation Email

 $to      = $_POST[email];

 $subject = ” YOURWEBSITE.com Registration”;

 $message = “Welcome to our website!rrYou, or someone using your
email address, has completed registration at YOURWEBSITE.com. You can
complete registration by clicking the following
link:r
this is an error, ignore this email and you will be removed from our
mailing list.rrRegards, YOURWEBSITE.com Team”;

 $headers = ‘From: noreply@ YOURWEBSITE.com’ . “rn” .  

     ‘Reply-To: noreply@ YOURWEBSITE.com’ . “rn” .  

     ‘X-Mailer: PHP/’ . phpversion();  

 mail($to, $subject, $message, $headers);

  1. 表达激活代码 verify.php
    一旦验证码相符,则激活客户。

复制代码 代码如下:
 $queryString = $_SERVER[‘QUERY_STRING’];

 $query = “SELECT * FROM users”;

 $result = mysql_query($query) or die(mysql_error());

 while($row = mysql_fetch_array($result)){  

     if ($queryString == $row[“activationkey”]){

        echo “Congratulations!” . $row[“username”] . ” is now the
proud new owner of a YOURWEBSITE.com account.”;

        $sql=”UPDATE users SET activationkey = ”, status=’activated’
WHERE (id = $row[id])”;         

        if (!mysql_query($sql)) {

           die(‘Error: ‘ . mysql_error());

        }          

         //
到此处,客商已经完全激活了账号,你能够将页面跳转到登录后的分界面了  

     }

   } // end of while

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图