Results 1 to 13 of 13

Thread: Why is html page not displaying

  1. #1
    Join Date
    Jun 2005

    Why is html page not displaying

    Hello, I have a little problem.

    What I want to understand first is:

    in when you are writing "/" in a source. example: "/files/file/file.jpg"

    Doesn't that mean that the file is stored on the same directory as the html file that is calling the jpg

    To clarify, say if I had an html file in a place like in my documents/htmlfiles/index.html

    And in the same directory I had another file called picture.jpg

    To call up that file in the html, do I just use "/picture.jpg"?

    I am asking you this, because I made an html file, and in the computer I use when I try to preview it, it can't display the images I have put on.

    But when I upload the webpage into another server, it does work.

    Does anyone know what the problem is?

    the webpage I have uploaded is here:

    There's no time like the present.

  2. #2
    Join Date
    Mar 2007
    No. When you use / or /picture.jpg you are telling the server that the file is located at root. Depending on you server configuration this could be the server root or the document root. In most cases I have run across it will be document root. For example, if you have a site foo.com which has a link <a href="/">Link</a> then this link would point to foo.com. <a href="/picture.jpg">picture</a> would resolve to foo.com/picture.jpg

  3. #3
    Join Date
    Mar 2006
    Newcastle NSW Australia
    If the picture is in the same folder as the html file, then using relative addressing you would refer to it as "picture.jpg" - the html and picture files can be both together in any folder of the site. "/picture.jpg" means the picture is in the root folder of the site, which in your case is true when uploaded, but not on your local machine. As an extra, if your pictures where in a folder called "images" and your html in the root folder, you reference it by "images/picture.jpg".

    edit: Damn, 1 minute too slow ....

  4. #4
    Join Date
    Jun 2005
    So your saying that I shouldn't put the slash in front of my sources, or otherwise, is there a simple way to do his without having to change the sources paths everytime I use my computer?
    There's no time like the present.

  5. #5
    Join Date
    Mar 2007
    If the file is in the document root, then use the slash. I like to have everything relative to the document root so I use it everywhere. So if my picture is in a directory called images then my url would be /images/pic.jpg

  6. #6
    Join Date
    Jun 2005
    So what is the document root, and where is it on my computer?

    Also this does not explain why another HTML page that I downloaded, also uses the same pathing ways, (always using "/") and it's working when I preview it.

    The other html page is located in the same place too, It is in however another folder...

    This site is the other site:

    There's no time like the present.

  7. #7
    Join Date
    Mar 2007
    The document root is whatever you specify it to be in the server configuration. ../phpBB2/index.php is VERY different from /phpBB2/index.php
    The first means one directory up from the current, then the phpBB2 directory. The second means that the phpBB2 directory is at the document root which may be /usr/www/phpBB2 or something like that.

  8. #8
    Join Date
    Jun 2005

    So how do I configure my router?


    If my HTML file is my documents on a windows pc,

    What Should I be using as my source?
    There's no time like the present.

  9. #9
    Join Date
    May 2005
    Northern Indiana
    Your router has absolutely nothing to do with any of this. What matters is your server. Likewise, the location on your computer has little to do with anything. If you want to be able to reliably preview your site on your computer, you should have a web server installed. In short, if you preview your file in the browser, and the address bar gives a local address (ex "C:\My Documents\myFile.html"), you can't rely on it being an accurate preview of how the site will behave on an actual file server. If you install a local web server, it would instead look like "http://localhost/myFile.html", and as far as your browser is concerned, it is an actual web site. When going that route, where the file is on your computer doesn't matter nearly as much as where your web server's directories are mapped.

    May I recommend starting off be reading some tutorials. The first would be something on relative links & how they work. This seems to cover the basics, but there may be other better ones:
    As with anything else on the web, there is no one "right" way to do your links. There are multiple ways you can set them up, and without being able to see your site's layout, it is hard to say which is the best in your particular situation. If there is any question, you can always just use absolute links instead- they're not as flexible and require a little more typing, but they're a lot easier to figure out- especially if you're not good at mentally mapping out relative paths.

    Second, read up on web servers. You can install IIS, Apache or a variety of other servers on your local pc for testing, but you need to understand how they work first.
    Last edited by Tweak4; 07-23-2007 at 09:58 AM.

  10. #10
    Join Date
    May 2003
    Andover, UK
    It may not be relevent here, but check also that there are no issues with upper & lower case. MS software ignores case in filenames and paths, unix/linux servers are case sensitive. For example if your link say mypic.jpg and the picture is called Mypic.jpg, it may not be found.

  11. #11
    Join Date
    Jun 2005
    Ok thanks, I was just wondering if there was a link style that meant the file was in the same directory that the file was stored in
    There's no time like the present.

  12. #12
    Join Date
    Mar 2006
    Newcastle NSW Australia
    Quote Originally Posted by Dragonkai
    Ok thanks, I was just wondering if there was a link style that meant the file was in the same directory that the file was stored in
    I thought I answered that in my post above .........

  13. #13
    Join Date
    Jun 2005
    Yes you did
    There's no time like the present.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.13573 seconds
  • Memory Usage 2,968KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (13)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (13)postbit
  • (13)postbit_onlinestatus
  • (13)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates