注意:未定义的索引:第9行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\ [英] Notice: undefined index: content in C:\xampp\htdocs\test\admin\insert_post.php on line 9
本文介绍了注意:未定义的索引:第9行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我点击提交按钮时,它显示上面的错误
我尝试过:
When I click the submit button it shows the error above
What I have tried:
<?php
include "db1.php";
include "config.php";
$db = new database();
if (isset($_POST['submit'])){
$title = $_POST['title'];
$content = $_POST['content'];
$query = "INSERT INTO posts(title,content) VALUES('$title',$content')";
$run=$db->insert($query);
}
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
<form action="insert_post.php" method="post" enctype="multipart/form-data">
<div class="form-group">
<center><table width="800" align="center" border="2">
<tr bgcolor="orange">
<td colspan="6"><h1 style="text-align:center">Post EDIT</h1></td>
</tr>
<tr>
<td align="right" bgcolor="orange">Post title:</td>
<td><input type="text" name="title" size="60"></td>
</tr>
<tr>
<td align="right" bgcolor="orange">Post Content:</td>
<td><textarea name="content" rows="15" cols="40"></textarea></td>
</tr>
<tr>
<td colspan="6" align="center" bgcolor="orange"><input type="Submit" name="submit" value="Publish Now" /></td>
</tr>
</table>
推荐答案
db = new database();
if(isset(
db = new database(); if (isset(
_POST ['submit'])){
_POST['submit'])){
title =
这篇关于注意:未定义的索引:第9行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文