?? 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 + -