Jump to content

image not showing with <? include("../header.php") ?>


bickyz

Recommended Posts

My webroot:

public_html
|_____mysite
                |___image
                |          |___all images here
                |
                |___photos
                |          |___gallery.php
                |
                |___index.php
                |
                |___header.php
           

I have a gallery.php page that INCLUDES header.php page like this [b]<? include("../header.php") ?>[/b]
When i run the gallery.php page the images are not showing at all.

Can somebody please help me.
Link to comment
https://forums.phpfreaks.com/topic/33339-image-not-showing-with/
Share on other sites

I have replaced the include with require but still its not working.

When i run http://www.mysite.com/header.php, all the image shows without any probs.

But if i run http://www.mysite.com/photos/gallery.php, the header page's images doesnt shows. In gallery.php page i have included header.php using [b]<? include("../header.php") ?>[/b]
Okay as I said, if it's JUST the images, you need to check the HTML source which is generated.
Right click on the page, view source, and look at the image src="". If it's wrong, you need to fix that path.

If you still can't get it, can I see the live example?
if you use the "http://..." path to your image files in your header.php, then it would solve the problem, i had this problem before, because when you are trying to include some page in other directories, images using relative path seemed to be recognize as the related path of the current file.
Ted

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.