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
Share on other sites

Just the images aren't showing? Check the html source for their paths.
Use require, and turn on error reporting. If you actually get some errors, it's a PHP problem. Otherwise your path to your images might be wrong.
Link to comment
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]
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.