note 126087 added to reserved.variables.get
| From: | AnAnonymousUser at main dot php dot net | Date: | Wed, 19 May 2021 03:51:16 +0000 |
| Subject: | note 126087 added to reserved.variables.get | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216396@lists.php.net to get a copy of this message | ||
<?php
// It is important to sanitize
// input! Otherwise, a bad actor
// could enter '<script src="evilscript.js"></script>'
// in a URL parameter. Assuming you echo it, this
// would inject scripts in an XSS attack.
//
// The solution:
$NAME = $_GET['NAME'];
// Bad:
echo $NAME;
// that one is vulnerable to XSS
// Good:
echo htmlspecialchars($NAME);
// Sanitizes input thoroughly.
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 8.45.42.165)
----
Manual Page -- https://php.net/manual/en/reserved.variables.get.php
Edit -- https://main.php.net/note/edit/126087
Del: integrated -- https://main.php.net/note/delete/126087/integrated
Del: useless -- https://main.php.net/note/delete/126087/useless
Del: bad code -- https://main.php.net/note/delete/126087/bad+code
Del: spam -- https://main.php.net/note/delete/126087/spam
Del: non-english -- https://main.php.net/note/delete/126087/non-english
Del: in docs -- https://main.php.net/note/delete/126087/in+docs
Del: other reasons-- https://main.php.net/note/delete/126087
Reject -- https://main.php.net/note/reject/126087
Search -- https://main.php.net/manage/user-notes.php