Forum Moderators: skibum
redir.php:
<?php
$f = fopen("redir.txt","r");
for( $i=1 ; $i<=$id ; $i++ )
{
$destination = fgets($f);
}
header("Location: " . $destination);
exit();
?>
So, if for example you had...
redir.txt:
[webmasterworld.com...]
[google.com...]
Then,
redir.php?id=1
would redirect to Webmaster World, and
redir.php?id=2
would redirect to Google.
I haven't tested this, and you should probably throw some error checking in the mix too. Certainly check that $id is numeric and the right sort of magnitude.
Hope this helps!
So, don't take risk. Use meta refresh.
Do you have a lots of different URLs to generate? Try to use both MySQL and PHP.