Hi I Need Random Link REdirect PHP code : i.e. randomly send users to listed few urls ive searched these 2 codes but none of them worked $sites = array( 'http://www.google.com/', 'http://www.msn.com/', 'http://www.yahoo.com/' ) header('Location: '.$sites[array_rand($sites)]); die(); Code (markup): <?php $num = Rand (1,3); switch ($num) { case 1: header('Location: http://www.site1.com//'); break; case 2: header('Location: http://www.site2.com/'); break; case 3: header('Location: http://www.site3.com//'); break; } ?> Code (markup): PLEASE he
randomize array more simple use shuffle. so your first code will become like this $sites = array( 'http://www.google.com/', 'http://www.msn.com/', 'http://www.yahoo.com/' ); shuffle($sites); header('Location: '.$sites[0]); die(); Code (markup): CMIIW