📄 addvotes.php
字号:
<?php
$submit=$_POST["submit"];
$title=$_POST["title"];
$times=$_POST["times"];
$types=$_POST["types"];
if (strlen($title)<1) {
echo "<script>alert('标题不能为空');history.back();</script>";
}
if (strstr($title,"'")) {
echo "<script>alert('标题含有非法字符');history.back();</script>";
}
$db=@mysql_connect("localhost","root","micronsky.net") or dir("数据库连接出错");
mysql_select_db("vote",$db);
if ($submit) {
$sql="insert into title (title,times,types) values ('$title','$times',$types)";
$result=mysql_query($sql,$db);
echo "<script>alert('投票标题添加成功!');location.href='addvote.php';</script>";
}
exit;
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -