开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜