image not appearing when including html file in php

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
victor
Forum Commoner
Posts: 65
Joined: Fri Feb 13, 2004 1:36 am

image not appearing when including html file in php

Post by victor »

Hi,

I have created a html header to be include() in php so as to standardize my web page layout.

The header looks fine when it is open as a html file with accompanied images folder, but does not show its images when i it is used as an include in my php files. Why?

I've attached my source for the html header below:

Code: Select all

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Web_header_Swimpal_FIND_A_CLASS_over = newImage("images/Web_header_Swimpal_FIND-A-04.gif");
		Web_header_Swimpal_COACHES_over = newImage("images/Web_header_Swimpal_COACHES-o.gif");
		Web_header_Swimpal_CONTACT_over = newImage("images/Web_header_Swimpal_CONTACT-o.gif");
		Web_header_Swimpal_ABOUT_US_over = newImage("images/Web_header_Swimpal_ABOUT-US-.gif");
		Web_header_Swimpal_MySWIMPAL_over = newImage("images/Web_header_Swimpal_MySWIM-13.gif");
		preloadFlag = true;
	}
}

</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="preloadImages();">

<table id="Table_01" width="874" height="73" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="8">
			<img src="images/Web_header_Swimpal_01.gif" width="874" height="52" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/Web_header_Swimpal_02.gif" width="403" height="21" alt=""></td>
		<td>
			<a href="#"
				onmouseover="changeImages('Web_header_Swimpal_FIND_A_CLASS', 'images/Web_header_Swimpal_FIND-A-04.gif'); return true;"
				onmouseout="changeImages('Web_header_Swimpal_FIND_A_CLASS', 'images/Web_header_Swimpal_FIND-A-CL.gif'); return true;"
				onmousedown="changeImages('Web_header_Swimpal_FIND_A_CLASS', 'images/Web_header_Swimpal_FIND-A-04.gif'); return true;"
				onmouseup="changeImages('Web_header_Swimpal_FIND_A_CLASS', 'images/Web_header_Swimpal_FIND-A-04.gif'); return true;">
				<img name="Web_header_Swimpal_FIND_A_CLASS" src="images/Web_header_Swimpal_FIND-A-CL.gif" width="88" height="21" border="0" alt=""></a></td>
		<td>
			<img src="images/Web_header_Swimpal_04.gif" width="12" height="21" alt=""></td>
		<td>
			<a href="#"
				onmouseover="changeImages('Web_header_Swimpal_COACHES', 'images/Web_header_Swimpal_COACHES-o.gif'); return true;"
				onmouseout="changeImages('Web_header_Swimpal_COACHES', 'images/Web_header_Swimpal_COACHES.gif'); return true;"
				onmousedown="changeImages('Web_header_Swimpal_COACHES', 'images/Web_header_Swimpal_COACHES-o.gif'); return true;"
				onmouseup="changeImages('Web_header_Swimpal_COACHES', 'images/Web_header_Swimpal_COACHES-o.gif'); return true;">
				<img name="Web_header_Swimpal_COACHES" src="images/Web_header_Swimpal_COACHES.gif" width="86" height="21" border="0" alt=""></a></td>
		<td>
			<a href="#"
				onmouseover="changeImages('Web_header_Swimpal_CONTACT', 'images/Web_header_Swimpal_CONTACT-o.gif'); return true;"
				onmouseout="changeImages('Web_header_Swimpal_CONTACT', 'images/Web_header_Swimpal_CONTACT.gif'); return true;"
				onmousedown="changeImages('Web_header_Swimpal_CONTACT', 'images/Web_header_Swimpal_CONTACT-o.gif'); return true;"
				onmouseup="changeImages('Web_header_Swimpal_CONTACT', 'images/Web_header_Swimpal_CONTACT-o.gif'); return true;">
				<img name="Web_header_Swimpal_CONTACT" src="images/Web_header_Swimpal_CONTACT.gif" width="82" height="21" border="0" alt=""></a></td>
		<td>
			<a href="#"
				onmouseover="changeImages('Web_header_Swimpal_ABOUT_US', 'images/Web_header_Swimpal_ABOUT-US-.gif'); return true;"
				onmouseout="changeImages('Web_header_Swimpal_ABOUT_US', 'images/Web_header_Swimpal_ABOUT-US.gif'); return true;"
				onmousedown="changeImages('Web_header_Swimpal_ABOUT_US', 'images/Web_header_Swimpal_ABOUT-US-.gif'); return true;"
				onmouseup="changeImages('Web_header_Swimpal_ABOUT_US', 'images/Web_header_Swimpal_ABOUT-US-.gif'); return true;">
				<img name="Web_header_Swimpal_ABOUT_US" src="images/Web_header_Swimpal_ABOUT-US.gif" width="88" height="21" border="0" alt=""></a></td>
		<td>
			<a href="#"
				onmouseover="changeImages('Web_header_Swimpal_MySWIMPAL', 'images/Web_header_Swimpal_MySWIM-13.gif'); return true;"
				onmouseout="changeImages('Web_header_Swimpal_MySWIMPAL', 'images/Web_header_Swimpal_MySWIMPAL.gif'); return true;"
				onmousedown="changeImages('Web_header_Swimpal_MySWIMPAL', 'images/Web_header_Swimpal_MySWIM-13.gif'); return true;"
				onmouseup="changeImages('Web_header_Swimpal_MySWIMPAL', 'images/Web_header_Swimpal_MySWIM-13.gif'); return true;">
				<img name="Web_header_Swimpal_MySWIMPAL" src="images/Web_header_Swimpal_MySWIMPAL.gif" width="87" height="21" border="0" alt=""></a></td>
		<td>
			<img src="images/Web_header_Swimpal_09.gif" width="28" height="21" alt=""></td>
	</tr>
</table>
</body>
</html>
some help pls ..
Post Reply