how recall a script of HTML? 
Author Message
 how recall a script of HTML?

when i write a script in perl to create a dinamic HTML document it get
as parameter of input the QUERY_STRING.So if in this form there are submit
bottoms when the user click them load next page.But if i must do some
controls on the first page i can do it only in the next page. if there rea
are same problems, for the controls, i should reload the first page but i
heve lost ,in the actual page, the parameters in input to this.
how i must do to take trace of the QUERY_STRING of the previous page loaded?



Fri, 14 Mar 1997 21:31:51 GMT  
 how recall a script of HTML?

Followups to comp.infosystems.www.providers.

Quote:

> when i write a script in perl to create a dinamic HTML document it get
> as parameter of input the QUERY_STRING.So if in this form there are submit
> bottoms when the user click them load next page.But if i must do some
> controls on the first page i can do it only in the next page. if there rea
> are same problems, for the controls, i should reload the first page but i
> heve lost ,in the actual page, the parameters in input to this.
> how i must do to take trace of the QUERY_STRING of the previous page loaded?


1) Some browsers (Mosaic for X 2.4, for example) retain the same values.  If
the user goes back to the query page (using the Back button, not reloading
the page!), the same values will still be listed.

2) You can regenerate the original form as part of your script, filling in
the same values as appropriate.  Example, using the cgi-lib.pl CGI library,
which puts input stuff into a %in associative array.  Note that the ACTION
item in the form is this self-same script.  The form is dynamic, too, you see.

#!/usr/bin/perl
require "cgi-lib.pl";

&ReadParse;

if ( $in{'item'} =~ /something ok/ ){
        do appropriate_stuff;

Quote:
} else ( /some input problem/ ) {

        print <<EOF
Content-type: text/html

<HTML>
<HEAD>
<TITLE>This is my form title</TITLE>
</HEAD>

<BODY>
<H1>My form</H1>
<FORM METHOD="POST" ACTION="/cgi-bin/myform.pl">
<INPUT NAME="item" VALUE="$in{'item'}">
<INPUT TYPE=submit VALUE="Do it">
<INPUT TYPE=reset VALUE="reset">
</FORM>
</BODY>
</HTML>
EOF

Quote:
}

--
Bob Myers                              Unocal Corporation

Phone: [714] 693-6951                  P. O. Box 68076
                                       Anaheim, California 92817-8076


Sat, 22 Mar 1997 08:28:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. recall script

2. Reloading/recalling a page

3. HTML form and Perl script send data to another Perl script

4. Can't call a script from html created by another script

5. Perl script: given database query, show html result table

6. Calling HTML from CGI script

7. Changing HTML with perl script

8. How do I excise scripts from html files?

9. Passing arguments to a script in HTML

10. Folio FFF to HTML perl script

11. exec perl script in html file

12. Call perl script in html page

 

 
Powered by phpBB® Forum Software