Landing page script.
http://www.bntnews.com/contest/rotateit.php
(edited version of it)
//run the make table script at the beginning of contest to create count table and initialize it
$hitcount=0;
$db = mysql_pconnect(hostname, username, password);
mysql_select_db(dbasename,$db);
$sql_str="select * from contest_hit_counter";
$result=mysql_query($sql_str, $db);
if (mysql_num_rows($result)===0){
echo "Didn't get the record back
";
}
else
{
$hitcount=mysql_result($result,0,"hitcount");
if ($hitcount>3){
$hitcount=1;
}
else
{
$hitcount=$hitcount+1;
}
$sql_str="update contest_hit_counter set hitcount=" . $hitcount ;
$result=mysql_query($sql_str, $db);
If ($hitcount===1){
echo "redirecting to team 1
";
echo 'header("Location:
http://www.team1url.com/")';
}
If ($hitcount===2){
echo "redirecting to team 2
";
echo 'header("Location:
http://www.team2url.com/")';
}
If ($hitcount===3){
echo "redirecting to team 3
";
echo 'header("Location:
http://www.team3url.com/")';
}
If ($hitcount===4){
echo "redirecting to team 4
";
echo 'header("Location:
http://www.team4url.com/")';
}
}