bickyz Posted January 8, 2007 Share Posted January 8, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/ Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155782 Share on other sites More sharing options...
bickyz Posted January 8, 2007 Author Share Posted January 8, 2007 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] Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155822 Share on other sites More sharing options...
Jessica Posted January 8, 2007 Share Posted January 8, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155828 Share on other sites More sharing options...
bickyz Posted January 8, 2007 Author Share Posted January 8, 2007 This is the link to the site im creatinghttp://71.18.194.21/mysite/index.phpheader.phphttp://71.18.194.21/mysite/header.phpgallery.phphttp://71.18.194.21/mysite/photos/gallery.php Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155895 Share on other sites More sharing options...
HuggieBear Posted January 8, 2007 Share Posted January 8, 2007 This is because the header.php gets included/required as if it were in the same directory as the file calling it.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155899 Share on other sites More sharing options...
Eddyon Posted January 8, 2007 Share Posted January 8, 2007 Its just a HTML problem, im guessing on header.php the image is linked to image/bg3.jpg... instead try /mysite/image/bg3.jpg or http://71.18.194.21/mysite/image/bg3.jpg should work then. Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155921 Share on other sites More sharing options...
bickyz Posted January 8, 2007 Author Share Posted January 8, 2007 thanks very much for help provided, i have used relative path like Eddyon said. Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155993 Share on other sites More sharing options...
ted_chou12 Posted January 8, 2007 Share Posted January 8, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/33339-image-not-showing-with/#findComment-155994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.