php includes and images

  • ndeb
  • Newbie
  • Newbie
  • ndeb
  • Posts: 8

Post 3+ Months Ago

Hi guys.
I have this problem I need help with. I created a page which included another page (with links to an image) in one website and everything worked fine. I then created a different website where I included another page (with links to an image) in the homepage. It seems there is something wrong because when I view the page with the image it looks fine but when I view the homepage the included page's image does not show up.
I tried removing the meta tags from the included page but it still wouldn't show in the homepage. Why is this not working when the same method worked in the other website?

Here is the code for the homepage, excluding irrelevant lines:
Code: [ Select ]
<?php
include ("personality.php");
?>
  1. <?php
  2. include ("personality.php");
  3. ?>


Here is the code for the personality.php page (shows fine when viewed in browser):
Code: [ Select ]
<div>
<h2>Personality of the Week!</h2>
<img src="../images/images_features/ckm.jpg" alt="featured_person" width="612" height="400" align="middle" />
</div>
  1. <div>
  2. <h2>Personality of the Week!</h2>
  3. <img src="../images/images_features/ckm.jpg" alt="featured_person" width="612" height="400" align="middle" />
  4. </div>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ndeb
  • Newbie
  • Newbie
  • ndeb
  • Posts: 8

Post 3+ Months Ago

With or without the following tags, the homepage simply doesn't show the image.
Code: [ Select ]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "...">
<html xmlns="...">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

</body>
</html>
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "...">
  2. <html xmlns="...">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6. </head>
  7. <body>
  8. </body>
  9. </html>
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

What happens if you replace

Code: [ Select ]
src="../


with this

Code: [ Select ]
src="/
  • ndeb
  • Newbie
  • Newbie
  • ndeb
  • Posts: 8

Post 3+ Months Ago

Thanks joebert.
Replacing with
Code: [ Select ]
src="/
won't work because of my folder structure. I also tried placing both files in the same folder so that I could directly use the image like this
Code: [ Select ]
src="somephoto.jpg"
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I would have to start looking through the access log for the site for references to the image at this point. I'd expect to see a 404 or 403 error along with the request telling me the path is wrong (404) or there's a permission issue (403)

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 83 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.