The original example can be found here:
Summary
A form element:
<form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
A piece of malicious code typed into the browser address bar by someone: http://www.example.com/test_form.php/%22%3E%3Cscript%3Ealert('hacked')%3C/script%3E
The example states that the form element will be converted to the following:
<form method="post" action="test_form.php/"><script>alert('hacked')</script>
While I get the idea, I don't understand why
- This even works when the web address is nonexistent. Shouldn't that person get an error page of some kind saying that the website cannot be found? Just like when we accidentally type in a wrong address and got nothing?
- Even though it works, how is anyone else besides the "hacker" himself affected if the change is not saved on the php file on the server? I mean it is the hacker who manually typed in the malicious code, and it is his browser that would download the affected web page.
I must've gotten some concepts wrong, badly. Please correct me. Thanks