Look at this URL in Chrome and Firefox.
http://gymshuffle.com/contact.html
If FF, there's uninterpreted PHP code on the page. In Chrome there isn't.
What would cause the PHP to display in Firefox?
That's interesting, it looks like Chrome realizes that what's between >?php and? < isn't a browser tag, and is instead maleformed HTML, and never lets it get to the rendered HTML tree. You can see a much simpler version of the same thing here
Source code
<?php echo ('test'); ?>
test
URL:
http://alanstorm.com/testbed/chrome-php.html
If you view source with Chrome the PHP code isn't displayed. If you do it with Firefox it is.
The important thing to remember here is that your PHP code isn't being executed. Chrome downloads the page with the raw PHP code in it, sees the raw PHP code, and removes it before rendering the page.
Update: Saw an upvote on this in 2015 -- and it looks like Chrome now does display the mentioned code.
Your http server is not configured to send .html-files through the php-interpreter. Try to rename your file from index.html
to index.php
. Chances are good that this will probably work - but really, please ask your server administrator for help in this configuration issue.
Regards
rbo
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