📄 20-10.php
字号:
<?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";
include "20-1.php";
$sql="select power from $bbs_user where name='$_COOKIE[user]'";
$temp=mysql_fetch_array(mysql_query($sql,$my_conn));
if($temp[0]<2)
{
echo "<div class=\"title\">你无权运行此页面<p>点<a href=\"20-5.php\">这里</a>返回</div>";
exit();
}
else
{
if(!$_POST["type"])
{
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\">添加论坛类别:";
echo "<select name=\"type\" size=\"1\">\n";
echo "<option value=\"m\">主论坛</option>\n";
echo "<option value=\"s\">分论坛</option>\n";
echo "</select>\n";
echo "</div>\n";
echo "<div class=\"title\"><input type=\"submit\" value=\"下一步\"></div>\n";
echo "</form>\n";
}
else if(!$_POST["type_n"])
{
echo "
<script language=\"javascript\">
<!--
function Juge(theForm)
{
if (theForm.type_n.value == \"\")
{
alert(\"请输入论坛名称!\");
theForm.type_n.focus();
return (false);
}
if (theForm.type_d.value == \"\")
{
alert(\"请输入论坛名称!\");
theForm.type_d.focus();
return (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=\"type\" value=\"".$_POST[type]."\">\n";
echo "<div class=\"title\">输入论坛名称:<input type=\"text\" name=\"type_n\" class=\"input\"></div>\n";
echo "<div class=\"title\">输入论坛介绍:<input type=\"text\" name=\"type_d\" class=\"input\"></div>\n";
if($_POST[type]=="s")
{
echo "<div class=\"title\">分论坛应属于:";
echo "<select name=\"m_id\" size=\"\" class=\"input\" style=\"width:151px\">\n";
$sql="select id,type_n from $bbs_type where m_id=0";
$result=mysql_query($sql,$my_conn);
while($row=mysql_fetch_array($result))
{
echo "<option value=\"".$row[id]."\">".$row[type_n]."</option>\n";
}
echo "</select>";
echo "</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
{
$type_n=$_POST["type_n"];
$type_d=$_POST["type_d"];
if($_POST["m_id"]) $m_id=$_POST["m_id"];
else $m_id=0;
$sql="INSERT INTO $bbs_type(m_id,type_n,type_d) VALUES ('$m_id','$type_n','$type_d')";
$result=(mysql_query($sql,$my_conn));
if($result)
{
echo "<div class=\"title\">添加论坛成功<p>点<a href=\"20-5.php\">这里</a>返回</div>";
}
else
{
echo "<div class=\"title\">添加论坛失败<p>点<a href=\"20-5.php\">这里</a>返回</div>";
}
}
}
echo "</div>";
echo "</doby>";
echo "</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -