<?
// A redirect header that applies random URLs to the link

if($in != "")  { 
    if (
$in == "rnd") {
       
$urls = array("http://www.yahoo.com/",
                     
"http://www.scriptschool.com/",
                     
"http://www.dalantech.com/",
                     
"http://www.google.com/");
       
srand(time());
       
$count count($urls);
       
$result rand(0,$count);
       
$in $urls[$result];
    }
    
header("Location: $in");
}
?>

<html>
<head><title>Header & Redirection</title>
<link rel="stylesheet" type="text/css" href="/css/scriptskewl.css">
</head>
<body>

<! --  Setting the $in variable "rnd"  -->

<a href="http://www.timslan.com/scriptskewl/week8/dropdown.php?in=rnd"
onMouseOver="window.status='Yes, you really do need to click this'; return true;"
onMouseOut="window.status='';">You really need to click here</a>


<! -- Form to populate the screen if $in is "" -->

<form method="POST" action="<? $PHP_SELF ?>">
<p><select name="in" size="1">
<option selected value="http://www.dalantech.com/">Da Lantech</option>
<option value="http://www.yahoo.com/">yahoo</option>
<option value="http://www.scriptschool.com/">Script School</option>
<option value="http://www.php.resourceindex.com.com/">php Resource</option>
<option value="http://www.google.com/">Google</option>
</select><input type="submit" value="Submit"></p>
</form>
<iframe src='dropdownsrc.php' width='100%' height='300'></iframe>
<a href='../index.html'>index</a>

</body>
</html>