Why doesn't Google Chrome show the PHP in the source?
For example, here's a page I did (mostly with JQuery). I decided to have a small bit of PHP to fetch the IP address and display it (in a beautified way) so that I could login remotely (because my IP changes because of DHCP).
So I wrote it; here's a couple of screenshots.
The source code in my editor:
The source code in the browsers viewsource:
Just to clarify, I blacked out the IP, but the IP is all it showed on the screen -- not the PHP that echoed the variable.
Why does it not show the actual PHP, and is there any way to view the PHP?
Another example is the site I curl
ed to get the ip, icanhazip.com. If you visit the page, it shows your ip; but if you view source in the browser, the page contains only the text of your ip, and none of the code that makes it happen.
How can I view the PHP source?
Thanks!
evamvid
<?php $_SERVER['REMOTE_ADDR']; ?>
$_SERVER['REMOTE_ADDR']
is the client's IP. He he trying to get the server's external IP. I'm not sayingshell_exec
is the best way to go about it, but your solution doesn't give the result he wants.