Random index

S

someusernamehere

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
 
N

nice.guy.nige

While the city slept, someusernamehere ([email protected])
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
 
S

someusernamehere

While the city slept, someusernamehere ([email protected])
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
 
S

someusernamehere

While the city slept, someusernamehere ([email protected])
feverishly typed...



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?
 
J

Jukka K. Korpela

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.
 
N

nice.guy.nige

While the city slept, Jukka K. Korpela ([email protected]) feverishly
typed...
Scripsit someusernamehere:


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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top