note 129949 added to reserved.variables.get

From: Date: Fri, 10 Jan 2025 10:01:55 +0000
Subject: note 129949 added to reserved.variables.get
Groups: php.notes 
Request: Send a blank email to php-notes+get-221762@lists.php.net to get a copy of this message
<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>"; 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['cr ---- 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/129949 Del: integrated -- https://main.php.net/note/delete/129949/integrated Del: useless -- https://main.php.net/note/delete/129949/useless Del: bad code -- https://main.php.net/note/delete/129949/bad+code Del: spam -- https://main.php.net/note/delete/129949/spam Del: non-english -- https://main.php.net/note/delete/129949/non-english Del: in docs -- https://main.php.net/note/delete/129949/in+docs Del: other reasons-- https://main.php.net/note/delete/129949 Reject -- https://main.php.net/note/reject/129949 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221762) next »