note 129951 added to reserved.variables.get

From: Date: Fri, 10 Jan 2025 10:12:38 +0000
Subject: note 129951 added to reserved.variables.get
Groups: php.notes 
Request: Send a blank email to php-notes+get-221764@lists.php.net to get a copy of this message
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous"> <title>Test Übung</title> </head> <body class="container-fluid pt-5"> <div class="container"> <?php $stmt = $conn->prepare("SELECT * FROM posts"); $stmt->execute(); $posts = $stmt->fetchAll(PDO::FETCH_ASSOC); echo '<table class="table table-striped">'; echo "<tr>"; echo "<th>id</th>"; echo "<th>user_id</th>"; echo "<th>title</th>" ; echo "<th>content</th>" ; echo "<th>created_at</th>"; echo "</tr>"; foreach ($posts as $post){ echo "<tr>"; echo "<td>" . $post['id'] . "</td>"; echo "<td>" . $post['user_id'] . "</td>"; echo "<td>" . $post['title'] . "</td>"; echo "<td>" . $post['content'] . "</td>"; echo "<td>" . $post['created_at'] . "</td>"; echo '<td><form method="get"><button type="submit" name="detail" value="'. $post['id'] . '" class="btn btn-primary">Details</button></form></td>'; echo '<td><form method="post"><button type="submit" name="detail" value="'. $post['id'] . '" class="btn btn-danger">Delete</button></form></td>'; echo "</tr>"; } echo "</table>"; ?> </div> <div class="container"> <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal" data-bs-whatever="@mdo">Add</button> <form method="post"> <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h1 class="modal-title fs-5" id="exampleModalLabel">New message</h1> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> </div> <div class="modal-body"> <div class="mb-3"> <label for="title" class="col-form-label">Title:</label> <input type="text" class="form-control" id="title" name="title"> </div> <div class="mb-3"> <label for="content" class="col-form-label">Content:</label> <textarea class="form-control" id="content" name="content"></textarea> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="submit" name="new" class="btn btn-primary">Send message</button> </div> </div> </div> </div> </form> <?php if(isset($_GET['detail'])){ $stmt = $conn->prepare("SELECT * FROM posts where id = :id"); $stmt->bindParam(':id', $_GET['detail']); $stmt->execute(); $posts = $stmt->fetchAll(PDO::FETCH_ASSOC); echo '<table class="table table-striped">'; echo "<tr>"; echo "<th>id</th>"; echo "<th>user_id</th>"; ---- 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/129951 Del: integrated -- https://main.php.net/note/delete/129951/integrated Del: useless -- https://main.php.net/note/delete/129951/useless Del: bad code -- https://main.php.net/note/delete/129951/bad+code Del: spam -- https://main.php.net/note/delete/129951/spam Del: non-english -- https://main.php.net/note/delete/129951/non-english Del: in docs -- https://main.php.net/note/delete/129951/in+docs Del: other reasons-- https://main.php.net/note/delete/129951 Reject -- https://main.php.net/note/reject/129951 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221764) next »