Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Random index

Reply
Thread Tools

Random index

 
 
someusernamehere
Guest
Posts: n/a
 
      07-20-2007
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

 
Reply With Quote
 
 
 
 
nice.guy.nige
Guest
Posts: n/a
 
      07-20-2007
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...ndex/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!"


 
Reply With Quote
 
 
 
 
someusernamehere
Guest
Posts: n/a
 
      07-20-2007
On Jul 20, 2:19 pm, "nice.guy.nige" <nigel_m...@deadspam.com> wrote:
> While the city slept, someusernamehere (someusernameh...@gmail.com)
> 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...ndex/index.php




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


muito obrigado

 
Reply With Quote
 
someusernamehere
Guest
Posts: n/a
 
      07-20-2007
On Jul 20, 2:19 pm, "nice.guy.nige" <nigel_m...@deadspam.com> wrote:
> While the city slept, someusernamehere (someusernameh...@gmail.com)
> 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?

 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      07-20-2007
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/
 
Reply With Quote
 
nice.guy.nige
Guest
Posts: n/a
 
      07-20-2007
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!"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" camelean@shaw.ca ASP .Net 3 02-22-2011 07:06 PM
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
sorting index-15, index-9, index-110 "the human way"? Tomasz Chmielewski Perl Misc 4 03-04-2008 05:01 PM
problem with index.html .(page is automatically gettin redirected to index.html) karthikeyavenkat Java 2 03-17-2005 10:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57