View Single Post

  #3 (permalink)  
Old 09-11-2006
Arpad Ray
 
Posts: n/a
Default Re: [PHP] Ajax and PHP: XMLHTTP

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
Reply With Quote