+ Reply to Thread
Results 1 to 5 of 5

Thread: HTML Problem - images not showing?

  1. #1
    bobrocket9942 is offline x10Hosting Member bobrocket9942 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    14

    Exclamation HTML Problem - images not showing?

    HTML Code:
    <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.

  2. #2
    John Rambo is offline x10Hosting Member John Rambo is an unknown quantity at this point
    Join Date
    Jun 2011
    Posts
    21

    Re: HTML Problem - images not showing?

    All the files are there! All are in the same directory too.
    are you sure?
    I see error, when go to http://bobcraft.x10.mx/Home.png

  3. #3
    bobrocket9942 is offline x10Hosting Member bobrocket9942 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    14

    Re: HTML Problem - images not showing?

    It's actually http://bobcraft.x10.mx/RequireThis/Home.png
    I have a top.php preset which is also in RequireThis so in the index I just call "<?php require('RequireThis/Top.php'); ?>"

  4. #4
    John Rambo is offline x10Hosting Member John Rambo is an unknown quantity at this point
    Join Date
    Jun 2011
    Posts
    21

    Re: HTML Problem - images not showing?

    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 /.

  5. #5
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: HTML Problem - images not showing?

    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 Code:
    <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.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

+ Reply to Thread

Similar Threads

  1. Not showing images?
    By artifexgroup75 in forum Free Hosting
    Replies: 10
    Last Post: 07-08-2010, 04:34 PM
  2. timthumb images are not showing up
    By lankatr in forum Free Hosting
    Replies: 1
    Last Post: 06-12-2010, 04:19 AM
  3. Images not showing
    By captainslow202 in forum Free Hosting
    Replies: 4
    Last Post: 01-24-2010, 01:49 PM
  4. images ... not showing
    By massimo in forum Free Hosting
    Replies: 4
    Last Post: 07-19-2008, 06:19 AM
  5. No Images showing, Iframe not showing file
    By zizzi0n in forum Free Hosting
    Replies: 13
    Last Post: 06-06-2008, 05:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers