Help Passing Information to Generic HTML Page

Discussion in 'HTML & Website Design' started by ljrw, Apr 27, 2007.

  1. #1
    This is probably trivial to do, but I've exhausted all my resources in trying to do it! And I cannot seem to find anyone who has done something like this and made an example of it.

    I have a generic HTML page (called dispict.html) that displays content. For argument's sake, let's assume it is a JPEG. I'd like to use this same page over and over again to display different pictures (jpeg01.jpg, jpeg02.jpg, jpeg03.jpg, etc.)

    I initially thought that I could invoke dispict.html and pass an argument in the URL and then use that argument in the file. Something like:

    http://www.anysite.com/dispict.html?dispjpg=jpeg01.jpg

    but that didn't work. Or if it would work, I couldn't figure out the right HTML code to make it work.

    Note: I don't need to capture anything from the user; I know the list of files I want to display. Furthermore, there's nothing confidential about this list of files, so I don't care if it is displayed in the URL or not.

    Any thoughts, ideas, suggestions, etc. about how to reuse a single HTML file to display different content using a URL argument would be greatly appreciated!
     
    ljrw, Apr 27, 2007 IP
  2. rfdavid

    rfdavid Peon

    Messages:
    106
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to use javascript to get the query variable. Check the example here.
     
    rfdavid, Apr 27, 2007 IP
  3. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Or you could use PHP, ASP, etc. You have the right idea... it's just HTML by itself can't accomplish it.
     
    rgchris, Apr 27, 2007 IP
  4. ljrw

    ljrw Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Many thanks! Using the javascript, I was able to accomplish exactly what I set out to do. Although I rarely post, I do read messages, and I think the people here represent the best of the internet community.
     
    ljrw, Apr 27, 2007 IP
  5. AffiliateD

    AffiliateD Guest

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thats very true
     
    AffiliateD, Apr 27, 2007 IP