note 127642 added to function.htmlspecialchars
| From: | php dot user1577 at gmail dot com | Date: | Thu, 15 Sep 2022 22:10:34 +0000 |
| Subject: | note 127642 added to function.htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219586@lists.php.net to get a copy of this message | ||
// Some simple script snippets for form processing
// ---------- page - formProcessing.php ----------
// POST
<?php
$name = '';
if (isset($_POST['submit'])) {
echo $name;
}
?>
// ... other HTML Code
<form action="formProcessing.php" method="post">
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text"
name="name"
class="form-control <?= isset($errors['name']) ?
'is-invalid' : '' ?>"
id="name"
placeholder="Your Name"
min="1"
max="32"
value="<?= htmlspecialchars($name) ?>"
required
>
</div>
<button type="submit" name="submit" class="btn btn-primary
mb-3">Submit</button>
<a href="queries.php" class="btn btn-secondary mb-3">Reset</a>
</form>
// ... other HTML Code
// ---------- Webside - formProcessing.php ----------
// GET
<?php
$name = '';
if (isset($_GET['name'])) {
$name = $_GET['name'];
echo $name;
}
?>
// ... other HTML Code
<?php
$name = 'My Name';
echo "<a href='formProcessing.php?name=$name'>Send Name as GET</a>"
?>
// ... other HTML Code
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.173 (proxied: 185.17.14.59)
----
Manual Page -- https://php.net/manual/en/function.htmlspecialchars.php
Edit -- https://main.php.net/note/edit/127642
Del: integrated -- https://main.php.net/note/delete/127642/integrated
Del: useless -- https://main.php.net/note/delete/127642/useless
Del: bad code -- https://main.php.net/note/delete/127642/bad+code
Del: spam -- https://main.php.net/note/delete/127642/spam
Del: non-english -- https://main.php.net/note/delete/127642/non-english
Del: in docs -- https://main.php.net/note/delete/127642/in+docs
Del: other reasons-- https://main.php.net/note/delete/127642
Reject -- https://main.php.net/note/reject/127642
Search -- https://main.php.net/manage/user-notes.php