Home > Backend Development > PHP Tutorial > PHP有关问题

PHP有关问题

WBOY
Release: 2016-06-13 10:24:43
Original
1105 people have browsed it

PHP问题求助
 
 include("conn.php");
 
 if ($_POST['submit']){
  $sql="insert into message (id,user,title,content,lastdate) values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
  mysql_query($sql);
  echo "";
 }
?>

最近学PHP,执行上面的代码时老是出现错误。但是功能是可以的。
Notice: Undefined index: submit in C:\wamp\www\S12\add.php on line 25

25行是 if ($_POST['submit']){

求解。

------解决方案--------------------

PHP code
if (isset($_POST['submit'])) { ... }<br><font color="#e78608">------解决方案--------------------</font><br>出现过类似的错误,不过,我不了解你其它地方是什么样的代码,只说我的情况。<br>
Copy after login
HTML code
<input type="checkbox" name="is_store_pwd">记住密码<input type="submit" value="submit"><div class="clear">
                 
              
              
        
            </div>
Copy after login
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