<?php
// $Id: random.php,v 1.4 2005/10/28 11:56:02 ohwada Exp $

// 2005-09-01 K.OHWADA
// BUG 2929: random jump becomes an infinite loop

//=========================================================
// random jump
// 2004-10-20 K.OHWADA
//=========================================================

include "header.php";

$lids = $tbl_link->getLidArrayByRandom(1);

// jump this site, if no data
if ( count($lids) == 0 )
{
	redirect_header(XOOPS_URL, 3, _WLS_NOMATCH);
}

$lid = intval( $lids[0] );
$tbl_link->countupHits($lid);
$url = $tbl_link->getSaniUrlByLid($lid);

// jump this site, if no url
if ( empty($url) )
{
	redirect_header(XOOPS_URL, 3, _WLS_NOMATCH);
}

?>
<html><head>
<meta http-equiv="Refresh" content="0; URL=<?php echo $url; ?>">
</head>
<body></body>
</html>
<?php

exit();

?>