<?php
$IP = "213.8.7.77";//GIDI
$port = 7002;
function redirectJS1( $uri ){ ?>
<script type="text/javascript">
<!--
parent.location.href="<?php echo $uri ?>";
-->
</script> <?
die();
}
$fp = @fsockopen($IP,$port,&$errno,&$errstr,30);
if (!$fp) {
redirectJS1('http://Beta.mcsi-inc.com/beta3/error.html');
exit();
}
else {
if (isset($_COOKIE["beta31"])) {
$sid = $_COOKIE["beta31"];
}
else {
redirectJS1('http://Beta.mcsi-inc.com/beta3/errorc.html'); // not found in the database
}
fputs($fp, "DISP$sid");
flush($fp);
$line="";
while($line=="") {
$line = fgets($fp,512);
fclose($fp);
}
}
if (substr($line,0,3)=="URI") {
$url1 = trim(substr($line,3)); // redirect to the new url
// URIhttp://Beta.mcsi-inc.com/beta3/error.html
redirectJS1($url1);
exit();
}
else
{
echo $line;
}
?>