<?php
if($_SERVER["REQUEST_METHOD"]=="POST")
{
$connect = mysqli_connect("localhost","root","");
mysqli_select_db($connect,"tegate");
$subject = $_POST["subject"];
$name = $_POST["name"];
$size = $_POST["size"];
$content = $_POST["content"];
$query = "Insert into exampaper(subject, name, size) values ('$subject','$name','$size');";
mysqli_query($connect, $query) or die (mysqli_error($connect));
$sql = "INSERT INTO exampaper (content) VALUES (?)";
$stmt = mysqli_prepare($connect,$sql);
mysqli_stmt_bind_param($stmt,"s",$content);
mysqli_stmt_execute($stmt);
$check = mysqli_stmt_affected_rows($stmt);
if($check == 1){
echo "Image Uploaded Successfully";
}else{
echo "Error Uploading Image";
}
mysqli_close($connect);
}
?>
我收到以下错误 - : 注意:未定义的索引:第13行的C:\ xampp \ htdocs \ TEGATE \ uploadpaper.php中的内容 上传图片时出错 我已经看到了所有相关问题,但我仍然无法找到错误。
$ content = $ _POST [“content”]; content字段的类型为mediumBlob,我想上传一个txt文件。我正在使用chrome的Postmaster应用程序检查php文件是否正常工作但是通过上面的行$ content = $ _POST [“content”];数据未与变量内容相关联。