skip to Main Content

I am moving a self made web app to newer computer. The old computer is running a 32 bit xampp in windows 7 32 bit (xampp-win32-1.8.3-5-VC11) and the new one is win 10 pro 64 bit. I organize all my web page on a folder that become a subfolder to the doc root. This folder have several subfolder for images, php codes, css styling. The problem is my web app broke and won’t display some part of it like in the old server.

I have try different web server package (incl WAMP, and Turnkey) with the same result. I suspect there is problem in referencing the files in my html code but I try to change it a bit to no avail. What confuse me is why the same code work in the old server while not in the new server. I even try to install the same xampp 32 bit (same version as old server) on win 10 64 bit but it still broke the web app.
As I suspect the problem in referencing files, also tried changing the -> img src=”/images/header.png” with img src=”../images/header.png” in header.php but it also does not work.

index.html part that will show header in browser:

<!-- BEGIN: Sticky Header -->
<div class="center-div">
<div id="header_container">
<div id="header" style="background-image: url(images/header_background.jpg); background-repeat: no-repeat;">
    <?php include('header/header.php'); ?>
    </div>
</div>
<!-- END: Sticky Header -->

header.php files

<a href="#"><img src="/images/header.png" alt="Insert Logo Here" width="1200" height="150" id="Insert_logo" style="display:block;" /></a>

Here is my directory structure:

mc
 |
 +-- index.html
 |    
 +-- header
 |  |  
 |  +-- header.php
 |    
 +-- images
 |  |  
 |  +-- header.png
 |  +-- header_background.jpg

I will access my web app my typing http://xxx.xxx.xxx.xxx/mc in the web browser.
The old server will show the header part correctly with both the header_background.jpg and header.png shown on the web app. But the new server will just show blank.
I am a relative newbie and I wrote this web app sometime ago. Any idea how to fix this? Many thanks in advance.

2

Answers


  1. Because you are using php code (php tag) in html file. here you should change file name index.html to index.php

    Login or Signup to reply.
  2. You have to rename index.html to index.php. Basically, you need to execute PHP code inside a PHP file. Right now, you are trying to execute some PHP scripts in HTML file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search