
sh.ajay12
User
Jun 10, 2014, 2:09 AM
Post #1 of 5
(5706 views)
|
The Get method does not shows the submit value in url
|
Can't Post
|
|
Hello Members, I am using a first.cgi script to pass two values to second.cgi script with GET method, but the values are not visible in the url. Please let me know, how to resolve this error. Please tell me some easy solution. Here is first.cgi http://opbay05nagios/cgi-bin/first.cgi?shortname=PEPSIO url our @LISTOFGRAPHS=`ls /usr/local/nagios/$SHORTNAME/etc/pnp4nagios/pages/*.cfg`; printf("<p>Select The File Name For The Report</p>\n"); printf("<FORM METHOD=GET ACTION=second.cgi>\n"); printf("<select name=file>\n"); printf("<option value= >Select Options</option>\n"); foreach my $link (@LISTOFGRAPHS) { my ($k, $v) = split(/\./, $link, 2); our $result=`grep page_name $link`; my ($a, $b) = split(/ /, $result, 2); (our $wanted)= $link =~ /pages\/(.*)\.cfg/g; printf("<option value= >$b</option>\n"); } printf("</select>\n"); printf("<select name=time>\n"); printf("<option value= >Select Options</option>\n"); printf("<option value= >Daily</option>\n"); printf("<option value= >Last 7 Days</option>\n"); printf("<option value= >Weekly</option>\n"); printf("<option value= >Monthly</option>\n"); printf("<option value= >Yearly</option>\n"); printf("</select>\n"); printf("<input type=submit value=Submit>\n"); printf("</FORM>\n"); print "</body></html>\n"; Here is the second.cgi script which process the values of GET method http://opbay05nagios/cgi-bin/second.cgi #!/usr/bin/perl use strict; use warnings; use warnings FATAL => qw(uninitialized); use CGI::Carp qw(warningsToBrowser fatalsToBrowser carpout); use CGI ':standard'; print "Content-type:text/html\n\n"; use CGI qw/:param/; our $filename = param('file'); our $time = param('time'); print header, start_html(-title=>$filename), h1("Welcome $filename"), h1("Welcome $time"), end_html; Thanks In Advance.
(This post was edited by sh.ajay12 on Jun 10, 2014, 2:12 AM)
|