Faraz
Active Member
The following code executes perfectly on the apache server installed on my PC, but it doesn't work when I upload to a webhost. I mean the page with the following code doesn't load up at all. Can you help?
Sorry, if you find it scattered and messy. :rolleyes2
<?
session_start();
session_register( "session" );
session_register( "hits" );
session_register( "codenumber" );
$session=session_id();
if ($code==$codenumber)
{
if ($HTTP_REFERER=="http://localhost/ute/main.php")
{
if ($B1=="Next Site")
{
$hits++;
}
}
else
{
header("Location: main.php");
}
}
?>
<html>
<head>
<title>New Page 1</title>
<SCRIPT>
var interval = "";
var i = 20;
var cn=<? print $codenumber=rand(1,1000);?>;
function EnableSubmit(whichButton)
{
if (document.getElementById)
{
// this is the way the standards work
document.getElementById(whichButton).disabled = false;
}
else if (document.all)
{
// this is the way old msie versions work
document.all[whichButton].disabled = false;
}
else if (document.layers)
{
// this is the way nn4 works
document.layers[whichButton].disabled = false;
}
}
function startInterval()
{
interval = window.setInterval("tTimer()",1000);
}
function stopInterval()
{
window.clearInterval (interval);
interval="";
}
function tTimer()
{
document.f.display.value = i--;
if (i == -1)
{
stopInterval();
EnableSubmit('mFormSubmit');
f.code.value=cn;
}
}
</script>
</head>
<body>
<form name="f" action="main.php" method=post>
<p><input type="text" name="display" value size="2"><?print " Hits registered: $hits";?>
<p><input type="submit" value="Next Site" id="mFormSubmit" name="B1" disabled>
<input type="hidden" name="code">
</form>
<script>
startInterval();
</script>
<form method="POST" action="done.php">
<p><input type="submit" value="Done" name="B2"></p>
</form>
<p align="center"><IFRAME src="frame.php" height="500" width="800">
</IFRAME></p>
</body>
</html>
Sorry, if you find it scattered and messy. :rolleyes2