note 129953 added to reserved.variables.get

From: Date: Fri, 10 Jan 2025 10:24:07 +0000
Subject: note 129953 added to reserved.variables.get
Groups: php.notes 
Request: Send a blank email to php-notes+get-221766@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/129953 Del: integrated -- https://main.php.net/note/delete/129953/integrated Del: useless -- https://main.php.net/note/delete/129953/useless Del: bad code -- https://main.php.net/note/delete/129953/bad+code Del: spam -- https://main.php.net/note/delete/129953/spam Del: non-english -- https://main.php.net/note/delete/129953/non-english Del: in docs -- https://main.php.net/note/delete/129953/in+docs Del: other reasons-- https://main.php.net/note/delete/129953 Reject -- https://main.php.net/note/reject/129953 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221766) next »