Reputation: 4029
The following Php file renders perfectly fine with Mozilla Firefox. However, when running the same on Google Chrome; result - It displays the entire HTML code instead of rendering it. Basically indicates that Google Chrome browser is unable to understand and display the HTML code.
abc.php File
<?php
session_start();//session is a way to store information (in variables) to be used across multiple pages.
?>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.12.3.js"></script>
.... //some lines of code
</html>
Upvotes: 2
Views: 1770
Reputation: 4029
Problem was
While Firefox browser parses and renders the HTML code. Google Chrome isn't able to understand that the php file is a HTML code in itself.
Solution
Placement of the DOCTYPE line as the FIRST LINE of the FILE
Hence the change is in the positioning of the DOCTYPE line indicating the type of document to be displayed on the browser.
abc.php File
<!DOCTYPE html>
<?php
session_start();//session is a way to store information (in variables) to be used across multiple pages.
?>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.12.3.js"></script>
.... //some lines of code
</html>
Upvotes: 1