if (isset($_SESSION['logged_in'])) {
if (isset($_POST['title'], $_POST['content'])) {
$title = $_POST['title'];
$content = $_POST['content'];
if (empty($title) or empty($content)) {
$error = 'All fields are required!';
} else {
$query = $pdo->prepare("INSERT INTO articles (atricle_title, atricle_text, atricle_timestamp) VALUES (?, ?, ?)")
$query->bindValue(1, $title); //error is here
$query->bindValue(2, $content);
$query->bindValue(3, time());
$query->execute();
header(Location: index.php);
}
有人知道这里有什么问题吗?代码本身不止于此,但这只是相关的部分。
谢谢。