So let's say I have a form tag like so. And I want to print the contents of the file to screen using JavaScript. How do I go about doing that?
<form action="/missions/basic/3/index.php" method="post">
<input type="hidden" name="file" value="file.php" />
<input type="password" name="password" />
<br />
<br />
<input type="submit" value="submit" />
</form>
What I want is to use the alert() function to show the contents of file.php, even though the contents are hidden.
What I want is to use the alert() function to show the contents of file.php, even though the contents are hidden.
You just can't. Don't waste your time :)
If your web server is configured correctly it will never output PHP code even if you could request that from JavaScript.
You can grab and show the output of a PHP file on the client but not its source code like that, unless there is a mess up or it is by design.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With