如果我删除此代码,我的页面就会加载。但是如果我添加这个,我会从我的网络矩阵中得到一个 HTTP 错误 500。
<?php
try {
if(isset(['submit'])) {
include('config.php');
$subject = $_POST['subject'];
$content = $_POST['editor1'];
$date = $_POST['date'];
$tags = $_POST['tags'];
$author = $_POST['author'];
$thumbnail = $_POST['thumbnail'];
$sql = "INSERT INTO articles (Subject, Content, Date, Author, Tags, Thumbnail) VALUES ('$subject','$content','$date','$author','$tags', '$thumbnail')";
$dbh->query($sql);
}
} catch(PDOException $e) {
echo $e->getMessage();
}
?>