Random index

Discussion in 'HTML' started by someusernamehere, Jul 20, 2007.

  1. Hey I have a web page translated into 3 languages, it's possible that
    when the page is visited load a random index?
    I have index.es.html index.pt.html index.en.html

    it's possible load ramdom this?

    thanks
    someusernamehere, Jul 20, 2007
    #1
    1. Advertising

  2. While the city slept, someusernamehere ()
    feverishly typed...

    > Hey I have a web page translated into 3 languages, it's possible that
    > when the page is visited load a random index?
    > I have index.es.html index.pt.html index.en.html
    >
    > it's possible load ramdom this?


    Yes it is, although wouldn't this be rather infuriating for your visitors?

    In any case, if you can run php on your server, the following will work.
    Save it as index.php;

    <?php

    $index = array( "index.es.html",
    "index.pt.html",
    "index.en.html");

    include $index[rand(0, 2)];

    ?>

    You can see it in action here:
    http://www.nigenet.org.uk/stuff/test/randomIndex/index.php

    Hope that helps,
    Nige

    --
    Nigel Moss http://www.nigenet.org.uk
    Mail address will bounce. | Take the DOG. out!
    "Your mother ate my dog!", "Not all of him!"
    nice.guy.nige, Jul 20, 2007
    #2
    1. Advertising

  3. On Jul 20, 2:19 pm, "nice.guy.nige" <> wrote:
    > While the city slept, someusernamehere ()
    > feverishly typed...
    >
    > > Hey I have a web page translated into 3 languages, it's possible that
    > > when the page is visited load a random index?
    > > I have index.es.html index.pt.html index.en.html

    >
    > > it's possible load ramdom this?

    >
    > Yes it is, although wouldn't this be rather infuriating for your visitors?
    >
    > In any case, if you can run php on your server, the following will work.
    > Save it as index.php;
    >
    > <?php
    >
    > $index = array( "index.es.html",
    > "index.pt.html",
    > "index.en.html");
    >
    > include $index[rand(0, 2)];
    >
    > ?>
    >
    > You can see it in action here:http://www.nigenet.org.uk/stuff/test/randomIndex/index.php




    hehehehe sure, this works fine for my !!! many thanks


    muito obrigado
    someusernamehere, Jul 20, 2007
    #3
  4. On Jul 20, 2:19 pm, "nice.guy.nige" <> wrote:
    > While the city slept, someusernamehere ()
    > feverishly typed...
    >
    > > Hey I have a web page translated into 3 languages, it's possible that
    > > when the page is visited load a random index?
    > > I have index.es.html index.pt.html index.en.html

    >
    > > it's possible load ramdom this?

    >
    > Yes it is, although wouldn't this be rather infuriating for your visitors?
    >
    > In any case, if you can run php on your server, the following will work.
    > Save it as index.php;
    >
    > <?php



    [...]


    additionaly I guess that only in HTML it's not possible?
    someusernamehere, Jul 20, 2007
    #4
  5. Scripsit someusernamehere:

    > hehehehe sure, this works fine for my !!! many thanks


    If that's a solution, I'm glad we don't need to see the (real) problem.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Jul 20, 2007
    #5
  6. While the city slept, Jukka K. Korpela () feverishly
    typed...

    > Scripsit someusernamehere:
    >
    >> hehehehe sure, this works fine for my !!! many thanks

    >
    > If that's a solution, I'm glad we don't need to see the (real)
    > problem.


    Well, yes it is a solution to what the OP asked for. And please remember
    that I started my post with the following line;

    "Yes it is, although wouldn't this be rather infuriating for your visitors?"

    Cheers,
    Nige

    --
    Nigel Moss http://www.nigenet.org.uk
    Mail address will bounce. | Take the DOG. out!
    "Your mother ate my dog!", "Not all of him!"
    nice.guy.nige, Jul 20, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karthikeyavenkat
    Replies:
    2
    Views:
    575
    Bryce
    Mar 17, 2005
  2. globalrev
    Replies:
    4
    Views:
    753
    Gabriel Genellina
    Apr 20, 2008
  3. Shawn W_
    Replies:
    5
    Views:
    270
    Aldric Giacomoni
    Sep 16, 2009
  4. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    278
    Tomasz Chmielewski
    Mar 4, 2008
  5. VK
    Replies:
    15
    Views:
    1,154
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page