Re: Ajax and PHP: XMLHTTP
| From: | Arpad Ray | Date: | Mon, 11 Sep 2006 13:34:08 +0000 |
| Subject: | Re: Ajax and PHP: XMLHTTP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241585@lists.php.net to get a copy of this message | ||
Micky Hulse wrote:
<?=$_SERVER['PHP_SELF']?> Can I replace the above with some sort of XMLHTTP request? As noted, that's a javascript question. However your PHP code is vulnerable to XSS attacks; you should at least encode the output with htmlspecialchars() so that URLs like "foo.php/<script>alert('hi');</script>" are safe.eg. <?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?> Arpad