Home > Backend Development > PHP Tutorial > 一个关于php构建测试表单的有关问题

一个关于php构建测试表单的有关问题

WBOY
Release: 2016-06-13 13:07:42
Original
806 people have browsed it

求助一个关于php构建测试表单的问题

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php $con=mysql_connect("localhost","root","");
mysql_select_db("test");
mysql_query("set names gb2312");
?>

Copy after login

这是初始的服务器config.
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
<?php error_reporting(E_ALL & ~ E_NOTICE);
echo "<center>";
if (!$_POST["test_name"])
{
    echo "<h2>create test</h2>";
    echo "
Copy after login
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
test question
"; } else { include 'config.php'; $content=$_POST["test_name"]; $sql="insert into question('content') values('$content')"; if (mysql_query($sql)) { echo "create test_content successfull!!!"; echo "

"; echo "clickhereto add question"; } else "error!!!".mysql_error(); mysql_close(); } echo "

"; ?>

现在问题是这样的,创建不了表单,求大神帮我指点指点...为什么会出现这样的状况..谢谢了

------解决方案--------------------
$sql="insert into question(`content`) values('$content')"; //content的注释符号写错了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template