I have created the following program. I want the program to ask the user to answer the first set of options. If they click the whole list, it goes to print_start_select, and if they click the choice option, it goes to the print_page_start. However, it shows all options and goes to cgi-bin/sub. Is it possible to do such a thing, and how? Please help.
#!/usr/bin/perl -w
print "Content-type:text/html\n\n";
use CGI;
$query = new CGI;
#testsub.cgi
print "<h2> FOR SALE</h2>\n";
# First we initialize some counters and hashes for storing the
# summarized data.
$countt =0;
$countt++;
$d ="\$";
print "<a href=\"&print_page_start\"> Do you want to choose by price? <a href=\"&print_start_select\"> Do you want to print the whole list of available product?\n<br>";
if ($query->param()) {
$search = $query->param('name');
print "<br><br>\n";
&print_start_select1;
# Wrap this code is an eval block in order to trap error
sub print_start_select {
print "all\n";
}
sub print_start_select1{
print "select\n";
}
}
else {
print "<FORM>\n";
print "<INPUT TYPE=\"text\" NAME=\"search\">Type the model, price, or year of the product?<BR>\n";
print "<input type=\"submit\"> <input type=\"reset\">\n";
print "<FORM>\n";
}
sub print_page_start {
print $query->header;
print "<html>\n<head>\n<TITLE>Search for Records</TITLE>\n";
print "</HEAD>\n<BODY>\n";
print "<h5><font color=\"blue\">HERE IS ONE \n";
print "<b><font color=\"black\"> YOU CAN LIST
E-MAIL.</h5>\n";
print "<H4><font color=\"red\"> click Submit Query</font>
</H4>\n";
}
print "</body>\n</html>\n";
#!/usr/bin/perl -w
print "Content-type:text/html\n\n";
use CGI;
$query = new CGI;
#testsub.cgi
print "<h2> FOR SALE</h2>\n";
# First we initialize some counters and hashes for storing the
# summarized data.
$countt =0;
$countt++;
$d ="\$";
print "<a href=\"&print_page_start\"> Do you want to choose by price? <a href=\"&print_start_select\"> Do you want to print the whole list of available product?\n<br>";
if ($query->param()) {
$search = $query->param('name');
print "<br><br>\n";
&print_start_select1;
# Wrap this code is an eval block in order to trap error
sub print_start_select {
print "all\n";
}
sub print_start_select1{
print "select\n";
}
}
else {
print "<FORM>\n";
print "<INPUT TYPE=\"text\" NAME=\"search\">Type the model, price, or year of the product?<BR>\n";
print "<input type=\"submit\"> <input type=\"reset\">\n";
print "<FORM>\n";
}
sub print_page_start {
print $query->header;
print "<html>\n<head>\n<TITLE>Search for Records</TITLE>\n";
print "</HEAD>\n<BODY>\n";
print "<h5><font color=\"blue\">HERE IS ONE \n";
print "<b><font color=\"black\"> YOU CAN LIST
E-MAIL.</h5>\n";
print "<H4><font color=\"red\"> click Submit Query</font>
</H4>\n";
}
print "</body>\n</html>\n";