Results 1 to 4 of 4

Thread: Display Link if file exists

  1. #1
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Display Link if file exists

    Im looking for some code to show a link to a file (PDF document) if it exists.
    If the PDF document doesnt exist, I dont want the link or the description to be displayed.

    Explanation:-

    This is for a web page that has a list of competition results throughout the year

    e.g.


    2006-06-25 Results 03 (link to 20060625.pdf)
    2006-05-07 Results 02 (link to 20060507.pdf)
    2006-04-01 Results 01 (link to 20060401.pdf)
    2006-03-25 Results 03 (link to 20060325.pdf)

    2006-03-07 Results 02 (link to 20060307.pdf)
    2006-02-01 Results 01 (link to 20060201.pdf)


    I want to create the web page with all the competition dates through the year, but only to display the ones that have the associated PDF uploaded (e.g. If only "20060201.pdf" & "20060307.pdf" just the bottom 2 lines would be displayed on the page)

    Thanks in advance

    John

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This really ought to be done server-side. With AJAX it's possible, but not advisable.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Being a novice at HTML this reply means little to me. When you say "This really ought to be done server-side" are you saying that what I’m after can't be done in JavaScript or something like that??

    I was hoping for a simply solution if there is such a thing

    Thanks
    John

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    When you say "This really ought to be done server-side" are you saying that what I’m after can't be done in JavaScript or something like that?
    Yes. You would need to use a server-side language like PHP or ASP, which would need to be configured on your server.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franais | entiendo espaol | ti t hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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