Top graphic continually changes - who do they do it?

Discussion in 'HTML' started by ©®, Sep 22, 2003.

  1. ©®

    ©® Guest

    At http://www.overloaded.com/ the top graphic changes when you go to a
    new page or refresh the page.
    How do they do it?
    Is there a plugin for Dreamweaver to do this?
    thanks
     
    ©®, Sep 22, 2003
    #1
    1. Advertisements

  2. there are any number of algos to pick one from a list of items - ask them?
    no idea
     
    William Tasso, Sep 22, 2003
    #2
    1. Advertisements

  3. ©®

    brucie Guest

    brucie, Sep 22, 2003
    #3
  4. Simple. Two ways I can think of:
    store all the images in a database and pick one at random

    use some server-side scripting to scan a directory of images,
    load them into an array and pick one at random. I do that here:
    http://new.hyweljenkins.co.uk/
     
    Hywel Jenkins, Sep 22, 2003
    #4
  5. ©®

    David Graham Guest

    Hi
    To get your example to work on my site hosted by phpwebhosting, I take the
    php from the second link and rename the file with a .php extension. This
    works OK - see http://p0c79.phpwebhosting.com/~p0c79/random-image2.php

    But you manage to get this to work from a page with a .html extension - how?

    How does the server know it has to process php instructions if the file does
    not have a .php extension. Obviously this is possible because you do this
    with your example, but once again, how?

    thanks
    david
     
    David Graham, Sep 22, 2003
    #5
  6. ©®

    brucie Guest

    i cant tell you its a big secret.
    oh all right, twist my arm

    in a .htaccess file:

    AddType application/x-httpd-php .html
     
    brucie, Sep 23, 2003
    #6
  7. In an .htacccess file:

    AddType application/x-httpd-php .html

    This says 'all files with the extension .html are PHP files'. Of course,
    the better thing to do is in your .htaccess file:

    Options +MultiViews

    This means that you don't need to link to 'http://example.org/myfile.php'
    or 'http://example.org/myfile.html', you can just link to
    'http://example.org/myfile' which is better because in the future you can
    replace it with a Perl file, a JSP file or a PDF file -- whichever takes
    your fancy.
     
    Toby A Inkster, Sep 23, 2003
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.