Basically I am trying to make a script that refreshes a website according to user defined urls, refresh intervals, amount of frames on the page, and amount of times to refresh.
http://www.thetwistingnether.com/alphasynaptic/auto_refresher/
That is the script as it is. It is just embedded in a frame.
The direct link is:
http://www.thetwistingnether.com/alphasynaptic/auto_refresher/auto_refresher.php
<?php
$url=$_GET['url'];
$seconds=$_GET['seconds'];
$windows=$_GET['windows'];
$hits=$_GET['hits'];
$hits-=$windows;
if(isset($_GET['url']))
{
if($hits>0)
{
echo "<html>
<head>
<title>Alphasynaptics Auto-Refresher</title>
<meta http-equiv='refresh' content='$seconds' URL='http://www.thetwistingnether.com/alphasynaptic/auto_refresher/auto_refresher.php?&url='$url'&seconds='$seconds'&windows='$windows'&hits='$hits''>
</head>";
if($windows==10)
{
echo "<frameset rows='50%,50%'>
<frameset cols='20%,20%,20%,20%,20%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='20%,20%,20%,20%,20%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==9)
{
echo "<frameset rows='33%,33%,33%'>
<frameset cols='33%,33%,33%'>
noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='33%,33%,33$'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='33%,33%,33$'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==8)
{
echo "<frameset rows='50%,50%'>
<frameset cols='25%,25%,25%,25%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='25%,25%,25%,25%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==7)
{
echo "<frameset rows='50%,50%'>
<frameset cols='25%,25%,25%,25%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='33%,33%,33%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==6)
{
echo "<frameset rows='50%,50%'>
<frameset cols='33%,33%,33%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='33%,33%,33%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==5)
{
echo "<frameset rows='50%,50%'>
<frameset cols='33%,33%,33%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='50%,50%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==4)
{
echo "<frameset rows='50%,50%'>
<frameset cols='50%,50%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='50%,50%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==3)
{
echo "<frameset rows='50%,50%'>
<frameset cols='50%,50%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>
<frameset cols='100%'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==2)
{
echo "<frameset rows='50%,50%'>
<frame src='$url' noresize scrolling='yes'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
if($windows==1)
{
echo "<frameset rows='100%'>
<frame src='$url' noresize scrolling='yes'>
</frameset>";
}
echo "</frameset>
<noframes>You suck!</noframes>
</html>";
}
else
{
include('form.inc');
}
}
else
{
include('form.inc');
}
?>
It loads the form include file:
http://www.thetwistingnether.com/alphasynaptic/auto_refresher/form.inc
<html>
<head><title>User Info Form</title></head>
<body>
<form enctype="multipart/form-data" action="http://www.thetwistingnether.com/alphasynaptic/auto_refresher/auto_refresher.php" method="GET">
What is the URL that you want to refresh? <input type="text" name='url' size="30" maxlength="100"><br>
How many seconds do you want there to be between each refresh? <input type="text" name='seconds' size="3" maxlength="3"><br>
How many hits do you want to your link? <input type="text" name='hits' size="5" maxlength="5"><br>
How many refresh windows do you want?
<select name='windows'>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
<p><input type="submit" name="submit" value="Start Refreshing">
</form>
</body>
</html>
My question is how do I get the $GET['hits'] variable to decrement properly? The problem is that the page just refreshes on end. This means that the if condition is always being met which means that $GET['hits'] is not decrementing as it should be. The operations are running smoothly, I echoed the results and they did the math properly except for they didn't count in the amount of times you have been refreshed. So I don't know what to do here, I've tried everything I could think of but can't seem to get it to function properly. I have tried POST already. But the POST variables were lost upon refresh. Anyone who can solve the GET problem or make the script work with POST will have my thanks. Also, I plan to use CASE STATEMENTS to make the code more effeciant once I fix this problem.
Thanks for the help in advance,