Hi
I'm trying to auto update a web page every 5 secs based on a check box on a previous page.
Here's my code..
PAGE 1
This launches a script somescript.pl which I want to update if the check box is checked. If the check box is not checked the page must display but not update..
PAGE 2
etc...
When I leave the box unchecked the $auto value is set to -1 which will not update - Cool, The problem is that when I check the checkbox the value is set to 5 only once. I think that the problem is that $auto_up is no longer eq to 'on' and the page refreshes once and sets the value of $auto to 5 first then to -1.
My Question is how do I keep the $auto to be 5 forever.. until I decide it must be different?
Many thanks for thousands of great tips ..
AcidHawk ----
Of All the things I've lost in my life it's my mind I miss the most.
I'm trying to auto update a web page every 5 secs based on a check box on a previous page.
Here's my code..
PAGE 1
Code:
print "<form action=./somescript.pl method=post><center>\n";
print "Enable Auto Update \n";
print "<input type=\"checkbox\" name=\"autoup\" value=\"on\"><P>\n";
print "<input type=\"submit\" value=\"View Summary\"></center>\n";
print "</form>
This launches a script somescript.pl which I want to update if the check box is checked. If the check box is not checked the page must display but not update..
PAGE 2
Code:
use CGI(":standard");
my $cgi = new CGI;
$auto_up = param("autoup");
#Set Update Time to 5Secs or 0Secs
if ($auto_up eq 'on') {
$auto = 5;
} else {
$auto = -1
}
# Create Header for CGI
print "Content-type:text/html\n\n";
print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"$auto\">";
When I leave the box unchecked the $auto value is set to -1 which will not update - Cool, The problem is that when I check the checkbox the value is set to 5 only once. I think that the problem is that $auto_up is no longer eq to 'on' and the page refreshes once and sets the value of $auto to 5 first then to -1.
My Question is how do I keep the $auto to be 5 forever.. until I decide it must be different?
Many thanks for thousands of great tips ..
AcidHawk ----
Of All the things I've lost in my life it's my mind I miss the most.