HTML Problem - images not showing?

bobrocket9942

New Member
Messages
14
Reaction score
0
Points
0
HTML:
<a href='http://bobcraft.x10.mx/index.php'><img src="Home.png" width="250" height="50" border="0px" onmouseover="this.src='Home2.png'" onmouseout="this.src='Home.png'"/></a><br />    <a href='http://bobcraft.x10.mx/Blog/'><img src="Blog.png" width="250" height="50" border="0px" onmouseover="this.src='Blog2.png'" onmouseout="this.src='Blog.png'" /></a><br />    <a href='http://bobcraft.x10.mx/order'><img src="Order.png" width="250" height="50" border="0px" onmouseover="this.src='Order2.png'" onmouseout="this.src='Order.png'"/></a><br />
All the files are there! All are in the same directory too.
 

John Rambo

New Member
Messages
27
Reaction score
0
Points
1
All the paths relative to directory where file resides. For http://bobcraft.x10.mx/index.php It is / so you need to change the path.
Code:
<img src="RequireThis/Home.png">
It does not matter where is included php file. Everything is related to the file where HTML content. In your case it is /index.php so all paths from /.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Required and included scripts don't run from their file system location, they run from where they're included/used. Basically, they're "included right here" as plain text wherever they're called, so in this case the images are in a directory level below the page the user is looking at.

In the case of images, CSS resources and JavaScript -- things that the browser has to request separately -- it's always best to use server-relative URLS:

HTML:
<img src="/images/filename.png">

where "images" is the directory in which the images are stored. The beginning slash tells the browser that to keep its current protocol and domain, so if it's looking at http://server.domain.tld/path1/path2/path3/page, it will request the image from http://server.domain.tld/images/filename.png.
 
Top