21,886
社区成员
发帖
与我相关
我的任务
分享
<form name="cateform" method="post" id="cateform" action="controller.php">
<table class="att-tab" >
<tbody >
<tr>
<td>高权重:</td>
<th><input type="text" class="text-sty" placeholder="请输入高权重" required name="weighth" id="weighth"></th>
</tr>
<tr>
<td>低权重:</td>
<th><input type="text" class="text-sty" placeholder="请输入低权重" required name="weightl" id="weightl"></th>
</tr>
<tr>
<td>TAG:</td>
<<th><input type="text" class="text-sty" placeholder="请输入TAG" required name="tag" id="tag"></th>
</tr>
<button type="submit" name="submit" id="submit" class="btn btn-success" >保存</button>
</form>
<?php
ob_start();
session_start();
?>
<?php
//检测是否登录,若没登录则转向登录界面
if(!isset($_SESSION['username'])){
header("Location:login.php");
exit();
}
?>
<?php
include "conn2.php";
if(isset($_POST['submit']))
{
$weighth=$_POST['weighth'];
$weightl=$_POST['weightl'];
$tag=$_POST['tag'];
$pasql=mysql_query("SELECT * FROM `chapter` where category='$category' and chapter='$chapter' and chapterlist='$chapterlist'");
$rowpa=Mysql_num_rows($pasql);
if($rowpa>0){
echo '<script>alert("此章节已存在!若修改请返回到总攻略页面修改!");window.location="gfz.php";</script>';
}
else{
$reatten=mysql_query("INSERT INTO `attention` (`category`,`chapter`,`chapterlist`,`weighth`,`weightl`,`tag`,`npcs`,`needs`,`npcg`,`needg`,`mainattention`,`skillstate`) VALUES ('$category','$chapter','$chapterlist','$weighth','$weightl','tag','$npcs','$needs','$npcg','$needg','$mainattention','$skillstate');");
echo '<script>alert("保存成功!");window.location="gfz.php";</script>';
}
}
?>