PHP Display Problems - code is displayed

Gary Croxford
Gary Croxford used Ask the Experts™
on
Thank you for looking at my question,

The IT department have installed Webmin on a MySQL server. I have written a bit of php code and saved it to the correct place on the server.

The code is a simple table and begins like this:
<?php # Script 1.0 - Section1.php
      require_once $_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/configinc.php';
      //require_once $_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/mysql_connect.php';
      
      $Page_Title = "KLTD E-D1";
      include($_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/CESTrack_Header.html');
      
      echo '<h2>CES Tracker</h2>';
      
      echo '<table width="100%">';
            echo '<tr>';
                  echo '<td align="center">';
                        echo '<table width="80%" border="2">';
                              echo '<tr>';
                                    echo '<td colspan="16">';
                                          echo '<h2>HONKER LTD CES DASHBOARD</h2>';
                                    echo '</td>';
                              echo '</tr>';
                              
                              echo '<tr>';
                                    echo '<td width="13%" align="left">';
                                          echo'<h2>Activity</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Queries</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>SENQ Enq/Quotations</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>SENQ Orders</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Projects</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Advanced Docs</h2>';
                                    echo '</td>';
                              echo '</tr>';


When I open the page using Chrome the page looks like this:

<?php # Script 1.0 - Section1.php
      require_once $_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/configinc.php';
      //require_once $_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/mysql_connect.php';
      
      $Page_Title = "KLTD E-D1";
      include($_SERVER['DOCUMENT_ROOT'] . '/CESTrack/Includes/CESTrack_Header.html');
      
      echo '<h2>CES Tracker</h2>';
      
      echo '<table width="100%">';
            echo '<tr>';
                  echo '<td align="center">';
                        echo '<table width="80%" border="2">';
                              echo '<tr>';
                                    echo '<td colspan="16">';
                                          echo '<h2>HONKER LTD CES DASHBOARD</h2>';
                                    echo '</td>';
                              echo '</tr>';
                              
                              echo '<tr>';
                                    echo '<td width="13%" align="left">';
                                          echo'<h2>Activity</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Queries</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>SENQ Enq/Quotations</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>SENQ Orders</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Projects</h2>';
                                    echo '</td>';
                                    
                                    echo '<td width="13%" align="center" colspan="3">';
                                          echo'<h2>Advanced Docs</h2>';
                                    echo '</td>';
                              echo '</tr>';
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Operations Support Analyst
Commented:
IT dept hadn't installed PHPMyAdmin - they have now
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I doubt PHPMyAdmin was the issue - if you were seeing code instead of rendered HTML then it is because the PHP processor on the server was not running.

I am guessing that the installation of PHPMyAdmin - also installed / activated PHP which is what solved the problem (as PHP is a dependency of PHPMyAdmin).

Clarifying as the problem could have been solved by installing PHP - without having to install PHPMyAdmin.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial