note 129948 added to reserved.variables.get
| From: | valentinbadstuber54@gmail.com | Date: | Fri, 10 Jan 2025 09:52:08 +0000 |
| Subject: | note 129948 added to reserved.variables.get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221761@lists.php.net to get a copy of this message | ||
<?php
require "connection.php";
//Zum adden von Posts
if($_SERVER['REQUEST_METHOD'] == 'POST' &&
isset($_POST['new'])){
if($_POST['title'] && $_POST['content']){
$stmt = $conn->prepare("INSERT INTO posts (user_id, title, content) VALUES
(:user_id, :title, :content)");
$stmt->bindParam(':user_id', $user_id);
$stmt->bindParam(':title', $title);
$stmt->bindParam(':content', $content);
$user_id = 1;
$title = $_POST['title'];
$content = $_POST['content'];
$stmt->execute();
}
}
//Zum löschen
if($_SERVER['REQUEST_METHOD'] == 'POST' &&
isset($_POST['detail'])){
$stmt = $conn->prepare("DELETE FROM posts where id = :id");
$stmt->bindParam(':id', $_POST['detail']);
$stmt->execute();
}
//ZUm updaten
if($_SERVER['REQUEST_METHOD'] == 'POST' &&
isset($_POST['update'])){
if($_POST['title'] && $_POST['content']){
$stmt = $conn->prepare("UPDATE posts SET title = :title, content = :content
WHERE id = :id");
$stmt->bindParam(':title', $title);
$stmt->bindParam(':content', $content);
$stmt->bindParam(':id', $_GET['detail']);
$title = $_POST['title'];
$content = $_POST['content'];
$stmt->execute();
}
}
?>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 193.170.70.27)
----
Manual Page -- https://php.net/manual/en/reserved.variables.get.php
Edit -- https://main.php.net/note/edit/129948
Del: integrated -- https://main.php.net/note/delete/129948/integrated
Del: useless -- https://main.php.net/note/delete/129948/useless
Del: bad code -- https://main.php.net/note/delete/129948/bad+code
Del: spam -- https://main.php.net/note/delete/129948/spam
Del: non-english -- https://main.php.net/note/delete/129948/non-english
Del: in docs -- https://main.php.net/note/delete/129948/in+docs
Del: other reasons-- https://main.php.net/note/delete/129948
Reject -- https://main.php.net/note/reject/129948
Search -- https://main.php.net/manage/user-notes.php