PHP写入my sql数据库问题
我写入数据库没反应,也没有错误提示。
PHP版本:PHP 5.3
请哪位大神帮我看看是哪里错误了好?实在没发现。谢谢。
<?php
require_once("check.php");
isset($_POST['post'])?$post=$_POST['post']:$post=null;
if($post=="post"){
$url_cat = $_POST['url_cat'];
$url_names = $_POST['url_names'];
$url_link = $_POST['url_link'];
$url_jj = $_POST['url_jj'];
$urlsql = "insert into dunling_link (url_cat,url_names,url_link,url_jj) values ('$url_cat','$url_names','$url_link','$url_jj')";
$urlsql = mysql_query($urlsql,$config);
echo "<script>alert('添加成功');location.href='?p=insert';</script>";
}
?>
<style>
table{
margin:0;
padding:0;
}
table tr td{
font-size:16px;
color: #393939;
}
table tr td input.input{
width:500px;
height:30px;
line-height: 30px;
}
</style>
<form method="post" action="" >
<input type="hidden" name="post" value="post" />
<table width="700" cellpadding="5" cellspacing="6">
<tr>
<th align="right" style="font-size: 18px;color: #6A3500;">
添加链接 »
</th>
<td></td>
</tr>
<tr>
<td align="right">网站分类:</td><td align="left"><input type="text" class="input" name="url_cat" /></td>
</tr>
<tr>
<td align="right">网站名称:</td><td align="left"><input type="text" class="input" name="url_names" /></td>
</tr>
<tr>
<td align="right">链接地址:</td><td align="left"><input type="text" class="input" name="url_link" value="http://" /></td>
</tr>
<tr>
<td align="right">链接简介:</td><td align="left"><input type="text" class="input" name="url_jj" /></td>
</tr>
<tr>
<td align="right"></td><td align="left"><input type="submit" value="保存" style="width: 150px;height:30px;" /></td>
</tr>
</table>
</form>