|
Posted by nice.guy.nige on 07/20/07 19:19
While the city slept, someusernamehere (someusernamehere@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/randomIndex/index.php
Hope that helps,
Nige
--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. nigel@DOG.nigenet.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"
[Back to original message]
|