Auto-redirect to a url containing a random number
There has been some questions on how to generate random numbers in URL links on this site, but what I am trying to do is when someone visits the website , it automatically redirect开发者_C百科s them to www.example.com/index.php?9999999 (where 9999999 is a 6 digit random number).
I am not getting anywhere with this so far. Can it be done?
Thanks a bunch in advance, Fraser
For a 6 digit random number, this should be good
<?php
header( 'Location: http://www.example.com/index.php?'.rand(100000,999999)) ;
?>
Place it on the page from which you want people to redirect
精彩评论