<?php
echo "<html>\n"; //输出标准HTML内容
echo "<head>\n";
echo "<title>\n";
echo "创建论坛\n";
echo "</title>\n";
echo "</head>\n";
echo "<body>\n";
echo "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\">\n";
echo "<div class=\"Frame\">\n";
if(!$_POST["admin"])
{
echo "
<script language=\"javascript\">
<!--
function Juge(theForm)
{
if (theForm.admin.value == \"\")
{
alert(\"请输入管理员名称!\");
theForm.admin.focus();
return (false);
}
if (theForm.pass.value == \"\")
{
alert(\"请输入管理员密码!\");
theForm.pass.focus();
return (false);
}
if (theForm.pass.value != theForm.re_pass.value)
{
alert(\"重复密码与密码不一致\");
theForm.re_pass.focus();
return (false);
}
if (theForm.nick_name.value == \"\")
{
alert(\"请输入管理员昵称!\");
theForm.nick_name.focus();
return (false);
}
}
-->
</script>";
echo "<div class=\"title\">论坛创建第一步</div>\n";
echo "<div class=\"main\"> </div>\n";
echo "<form action=\"".$_SERVER[PHP_SELF]."\" method=\"post\" onsubmit=\"return Juge(this)\">\n";
echo "<div class=\"title\">管理员名称:<input type=\"text\" name=\"admin\" class=\"input\"></div>\n";
echo "<div class=\"title\">管理员密码:<input type=\"password\" name=\"pass\" size=\"21\" class=\"input\"></div>\n";
echo "<div class=\"title\">再输入密码:<input type=\"password\" name=\"re_pass\" size=\"21\" class=\"input\"></div>\n";
echo "<div class=\"title\">管理员信箱:<input type=\"text\" name=\"email\" class=\"input\"></div>\n";
echo "<div class=\"title\">管理员昵称:<input type=\"text\" name=\"nick_name\" class=\"input\"></div>\n";
echo "<div class=\"title\"><input type=\"submit\" value=\"下一步\"></div>\n";
echo "</form>\n";
}
else if(!$_POST["m_type"] and !$_POST["c_m"])
{
echo "
<script language=\"javascript\">
<!--
function Juge(theForm)
{
obj=document.f.c_m;
if(obj.checked==false)
{
if (theForm.m_type.value == \"\")
{
alert(\"请输入主论坛名称!\");
theForm.m_type.focus();
return (false);
}
if (theForm.m_des.value == \"\")
{
alert(\"请输入主论坛介绍!\");
theForm.m_des.focus();
return (false);
}
if (theForm.s_type.value == \"\")
{
alert(\"请输入分论坛名称!\");
theForm.s_type.focus();
return (false);
}
if (theForm.s_des.value == \"\")
{
alert(\"请输入分论坛简介\");
theForm.s_des.focus();
return (false);
}
}
}
function change()
{
obj=document.f.c_m;
if(obj.checked==true)
{
document.f.m_type.disabled=true;
document.f.m_des.disabled=true;
document.f.s_type.disabled=true;
document.f.s_des.disabled=true;
}
else
{
document.f.m_type.disabled=false;
document.f.m_des.disabled=false;
document.f.s_type.disabled=false;
document.f.s_des.disabled=false;
}
}
-->
</script>\n";
echo "<div class=\"title\">论坛创建第二步</div>\n";
echo "<div class=\"main\"> </div>\n\n";
echo "<form name=\"f\" action=\"".$_SERVER[PHP_SELF]."\" method=\"post\" onsubmit=\"return Juge(this)\">\n";
echo "<input type=\"hidden\" name=\"admin\" value=\"".$_POST[admin]."\">\n";
echo "<input type=\"hidden\" name=\"pass\" value=\"".$_POST[pass]."\">\n";
echo "<input type=\"hidden\" name=\"email\" value=\"".$_POST[email]."\">\n";
echo "<input type=\"hidden\" name=\"nick_name\" value=\"".$_POST[nick_name]."\">\n";
echo "<div class=\"title\">默认论坛主类别:<input type=\"text\" name=\"m_type\" class=\"input\"></div>\n";
echo "<div class=\"title\">论坛主类别介绍:<input type=\"text\" name=\"m_des\" class=\"input\"></div>\n";
echo "<div class=\"title\">默认论坛分类别:<input type=\"text\" name=\"s_type\" class=\"input\"></div>\n";
echo "<div class=\"title\">论坛分类别介绍:<input type=\"text\" name=\"s_des\" class=\"input\"></div>\n";
echo "<div class=\"title\">不创建默认论坛:<input type=\"checkbox\" name=\"c_m\" onclick=\"change()\"></div>\n";
echo "<div class=\"title\"><input type=\"button\" value=\"上一步\" onclick=\"history.go(-1)\">";
echo "<input type=\"submit\" value=\"下一步\"></div>\n";
echo "</form>\n";
}
else
{
include "21-1.php";
$admin=$_POST["admin"];
$pass=md5($_POST["pass"]);
$email=$_POST["email"];
$nick_name=$_POST["nick_name"];
$date=date("Y-m-d");
$sql1="CREATE TABLE $bbs_user(
id int(6) not null primary key auto_increment,
name varchar(12) not null default '',
pass varchar(40) not null default '',
nickname varchar(12) not null default '',
sex enum('boy','girl') default 'boy',
email varchar(80) not null default '',
photo varchar(80) not null default '',
q_name varchar(200) not null default '',
post_num int(6) not null default 0,
reg_date varchar(20) not null default '',
power int(1) not null default 0
)";
$result1=mysql_query($sql1,$my_conn);
$sql2="CREATE TABLE $bbs_type(
id int(6) not null primary key auto_increment,
m_id int(6) not null default 0,
type_n varchar(12) not null default '',
type_d varchar(80) not null default '',
last_post_id int(6) not null default 0,
p_count int(6) not null default 0,
m_count int(6) not null default 0,
admin int(6) not null default 0
)";
$result2=mysql_query($sql2,$my_conn);
$sql3="CREATE TABLE $bbs_post(
id int(6) not null primary key auto_increment,
type_id int(6) not null default 0,
re_id int(6) not null default 0,
poster_id int(6) not null default 0,
title varchar(40) not null default '',
content text not null,
v_num int(6) not null default 0,
r_num int(6) not null default 0,
p_time varchar(40) not null default '',
r_time varchar(40) not null default ''
)";
$result3=mysql_query($sql3,$my_conn);
$sql4="INSERT INTO $bbs_user(name,pass,nickname,email,reg_date,power) VALUES ('$admin','$pass','$nick_name','$email','$date',2)";
$result4=mysql_query($sql4);
if(!$_POST["c_m"])
{
echo "<div class=\"title\">用户选择创建默认论坛</div>";
$m_type=$_POST["m_type"];
$m_des=$_POST["m_des"];
$s_type=$_POST["s_type"];
$s_des=$_POST["s_des"];
$sql="INSERT INTO $bbs_type(m_id,type_n,type_d) VALUES (0,'$m_type','$m_des'),(1,'$s_type','$s_des')";
mysql_query($sql,$my_conn);
}
else
{
echo "<div class=\"title\">用户选择不创建默认论坛</div>";
}
mysql_close($my_conn);
if($result1 and $result2 and $result3 and $result4)
{
echo "<div class=\"title\">论坛成功安装<p>点<a href=\"21-4.php\">这里</a>进行登录<p>并在后台删除该文件</div>";
}
else
{
echo "<div class=\"title\">论坛安装过程中出现问题<p>请重新运行此程序</div>";
}
}
echo "</div>";
echo "</doby>";
echo "</html>";
?>
没有合适的资源?快使用搜索试试~ 我知道了~
PHP+Ajax完全自学手册(珍藏版)电子教案及源代码
共414个文件
php:251个
gif:76个
htm:43个
4星 · 超过85%的资源 需积分: 9 127 下载量 94 浏览量
2009-07-30
09:33:11
上传
评论
收藏 6.74MB RAR 举报
温馨提示
本人昨天刚刚买的PHP+Ajax完全自学手册,花了一大笔银子,现将随书电子教案和源代码上传上来,共享给大家!
资源推荐
资源详情
资源评论
收起资源包目录
PHP+Ajax完全自学手册(珍藏版)电子教案及源代码 (414个子文件)
style.css 1KB
style.css 1KB
skin03.css 840B
skin01.css 632B
skin02.css 553B
Thumbs.db 45KB
Thumbs.db 45KB
Thumbs.db 17KB
juxie.gif 11KB
shizi.gif 10KB
jinniu.gif 10KB
tianxie.gif 10KB
baiyang.gif 10KB
chunu.gif 10KB
shuiping.gif 9KB
shuangzi.gif 9KB
shuangyu.gif 8KB
tiancheng.gif 8KB
sheshou.gif 8KB
mojie.gif 7KB
bg.gif 5KB
1.gif 2KB
box.gif 2KB
7.gif 1KB
7.gif 1KB
7.gif 1KB
input_bg.gif 1KB
9.gif 600B
9.gif 600B
9.gif 600B
10.gif 598B
10.gif 598B
10.gif 598B
1.gif 588B
1.gif 588B
1.gif 588B
12.gif 571B
12.gif 571B
12.gif 571B
6.gif 568B
6.gif 568B
6.gif 568B
2.gif 565B
2.gif 565B
2.gif 565B
11.gif 561B
11.gif 561B
11.gif 561B
4.gif 541B
8.gif 541B
8.gif 541B
4.gif 541B
4.gif 541B
8.gif 541B
5.gif 527B
5.gif 527B
5.gif 527B
3.gif 522B
3.gif 522B
3.gif 522B
10.gif 484B
10.gif 484B
1.gif 438B
1.gif 438B
2.gif 412B
2.gif 412B
7.gif 410B
7.gif 410B
9.gif 374B
9.gif 374B
6.gif 356B
6.gif 356B
8.gif 345B
8.gif 345B
4.gif 327B
12.gif 327B
12.gif 327B
4.gif 327B
11.gif 309B
11.gif 309B
5.gif 300B
5.gif 300B
3.gif 287B
3.gif 287B
19-index.htm 6KB
19-1.htm 6KB
18-2.htm 5KB
17-8.htm 4KB
18-3.htm 4KB
19-login.htm 3KB
18-1.htm 3KB
17-2.htm 3KB
3-20.htm 3KB
17-9.htm 2KB
17-6.htm 2KB
18-4.htm 2KB
17-3.htm 2KB
17-7.htm 1KB
16-1.htm 1KB
17-1.htm 1KB
共 414 条
- 1
- 2
- 3
- 4
- 5
资源评论
- 夜是月亮的蓝2012-07-24比较适合新手学习
- koukou_000011112012-12-12比较适合于新手学习
- 想学就是懒2013-03-06俺是新手,应该正好。
大漠&孤烟
- 粉丝: 1
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功