php无法传输form怎么办-PHP问题

资源魔 15 0

php无奈传输form的值怎样办?

谬误代码;

html页代码:
<form action="show.php" target="mainFrame" method="post">
<input type="text" name="words" cols="200"/><input type="submit" value="讲话"/>
php页代码:
<?php require_once('config.php'); ?><?phpmysql_select_db("data");$words=$_post['words'];if($words){$query="insert into chat(chtime,nick,words,face)values(now(),'$nick','$words','$face')";//拔出SQL语句mysql_query($query,$link_ID); //发送留言到数据库header("refresh:0; URL='show.php'"); }
?>

处理方法:

php是区别巨细写的,用$_POST看看。

另一个,html局部,看没有到form的完结符。

<form method="post" action="show.php" enctype="application/x-www-form-urlencoded" name="form1" id="form1">
<input type="text" name="words" value="" />
<input type="submit" value="讲话"/>
</form>
<?php
mysql_select_db("data");
$words = $_POST["words"];
if($words){
$query="insert into chat(chtime,nick,words,face)values(now(),'$nick','$words','$face')";//拔出SQL语句
mysql_query($query,$link_ID); //发送留言到数据库
header("refresh:0; URL='show.php'"); }
?>

照下面的欠缺一上,假如还没有行,正在mysql_select_db("data");后面加一个 print_r($_POST); 看能输入甚么数据。

更多PHP相干常识,请拜访PHP中文网!

以上就是php无奈传输form怎样办的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题

抱歉,评论功能暂时关闭!