Page 1 of 1

Broken images - displaying with dreaded red x

Posted: Tue Mar 23, 2010 10:05 am
by newnewbie
Like my id says....really new at this. My page is created with several "require"s. I bring in the header image from one php file, the navigation from another php file. The "required" file displays the images correctly. But, in the generated page, a red x is displayed where the images should be (but the alt text is displayed). As you can see I have used both relative and absolute paths with no luck. Here is the code for the generated page where the images do not display:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<?php
//$page_title = "Home";
$page_title = "Home";
?>
<title>
<?php
print $page_title;
?>
</title>
</head>

<body>

<?php
require_once("core/page_header.php");

require_once("c:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/my_starz/core/nav_menu.php");

?>

</body>
</html>

Here is the code from header.php which displays the header image correctly:

<div class="topOfpage" ><img src="../_img/header_imgs/header_img.gif" alt="Different Starz" name="imgHeader" width="800" height="169" border="0" usemap="#imgHeaderMap" id="imgHeader" />

<!--is map--->

<map name="imgHeaderMap" id="imgHeaderMap">
<area shape="rect" coords="715,138,778,166" href="../site/login/index.php" alt="Log In" />
</map>
</div>

Thanks for suggestions/corrections!

Re: Broken images - displaying with dreaded red x

Posted: Tue Mar 23, 2010 10:52 am
by AbraCadaver
The image path is relative to the main page, not the required one:

Code: Select all

<img src="_img/header_imgs/header_img.gif" alt="Different Starz" name="imgHeader" width="800" height="169" border="0" usemap="#imgHeaderMap" id="imgHeader" />

Re: Broken images - displaying with dreaded red x

Posted: Tue Mar 23, 2010 11:06 am
by newnewbie
WOW! Thank you so much for sharing your expertise! Obviously, it worked.