schwenn has asked for the wisdom of the Perl Monks concerning the following question:
Ip2loc.pl creates an HTML form with cgi.pm, and "prints" it to the browser. When ip2loc.pl is initially executed, it creates the form properly but does not wait for the Submit to be pushed before going ahead and processing the (null) output from the form. Eventually, when the form is filled out and the Submit button IS pushed, ip2loc.pl executes in its entirety (from its beginning) a second time. This second time the data is present and duly processed by ip2loc.pl.
How do I get ip2loc.pl to pause after creating the form until the Submit button is pushed?
[Possibly involved: my script is initiated from the middle of an HTML page (which of course already has a header) which forms a boilerplate style frame for my script's Form. My script issues a header too (implicit action of the start_html() call - see attachment below). Perhaps a single HTML page cannot have two headers. If this is the case, my question becomes: how would I prevent CGI.pm from issuing a header for the Form in question?]
... use CGI ':standard'; .... print start_html('Get Email Address'), h3('Input the email address to receive the Download Link:'), startform("GET"), "Email Address : ", textfield("clientEmail",""), " ", submit("Submit"),"<br/><br/ >", endform(), ; ...
20080718 Janitored by Corion: Fixed square brackets, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cgi script executing twice
by pc88mxer (Vicar) on Jul 17, 2008 at 15:38 UTC | |
|
Re: Cgi script executing twice
by bradcathey (Prior) on Jul 17, 2008 at 15:46 UTC | |
|
Re: Cgi script executing twice
by pileofrogs (Priest) on Jul 17, 2008 at 16:50 UTC |