Just casual paranoia. Let’s say we have an index.php:
<?php
exit('Forbidden!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<title>Can you see me?</title>
<script language="javascript" type="text/javascript">
alert("Welcome!");
</script>
<p>You got me.</p>
</html>
Can an external user somehow reach the “Welcome!” message? And why yes/not?
Any means are valid (e.g. viewing the source code for the page).
Thank you in advance!
The only way the PHP code could be skipped here is if the web server was misconfigured, and failed to handle a
.phpfile by passing it to the PHP interpreter. Instead it would be output as HTML, and the code would be visible by viewing the page source.As long as the file is handled as a PHP script and the PHP code gets parsed, it will execute correctly. There’s no means of circumventing
exit().