How do I get ip2loc.pl to pause after creating the form until the Submit button is pushed?Your script will not explicitly pause. The logic of your application is (or should be):
The first time your page is called there are no form variables submitted so your script will just display the input form. When the user hits the Submit button your script is called again. This time, however, there are form variables present in the request so your script will perform the action based on the submitted values.if there are submitted form variables then perform the requested action else display the form end if
A way to check if form variables are present is to simply check param():
use CGI qw/:standard/; ... if (param()) { # form variables present } else { # display the form }
In reply to Re: Cgi script executing twice
by pc88mxer
in thread Cgi script executing twice
by schwenn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |