note 129965 added to reserved.variables.session
| From: | janole2333@gmail.com | Date: | Fri, 10 Jan 2025 11:18:44 +0000 |
| Subject: | note 129965 added to reserved.variables.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221779@lists.php.net to get a copy of this message | ||
</div> 2
<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['created_at'] .
"</td>";
echo '<td><button value="'. $post['id'] .
'" class="btn btn-warning" data-bs-toggle="modal"
data-bs-target="#update">Update</button></td>';
echo "</tr>";
}
echo "</table>";
$stmt = $conn->prepare("SELECT content from posts WHERE id = :id");
$stmt->bindParam(':id', $post['id']);
$stmt->execute();
$content = $stmt->fetch();
}
?>
----
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.session.php
Edit -- https://main.php.net/note/edit/129965
Del: integrated -- https://main.php.net/note/delete/129965/integrated
Del: useless -- https://main.php.net/note/delete/129965/useless
Del: bad code -- https://main.php.net/note/delete/129965/bad+code
Del: spam -- https://main.php.net/note/delete/129965/spam
Del: non-english -- https://main.php.net/note/delete/129965/non-english
Del: in docs -- https://main.php.net/note/delete/129965/in+docs
Del: other reasons-- https://main.php.net/note/delete/129965
Reject -- https://main.php.net/note/reject/129965
Search -- https://main.php.net/manage/user-notes.php