gayu_justin has asked for the wisdom of the Perl Monks concerning the following question:

Following is the code from my template file ;
<form name = "employee" method = "post" action = "output.cgi?team_id=[ +% team_id %]&fromdate=[% fromdate %]&todate=[% todate %]"> <tr> <td> <!-- <p><font color="red"> Available Groups</fo +nt> </p> --> <select name = "employee" id = "emp"> <option value = ''> select </option> [% FOREACH employee_list IN employee %] <option value="[% employee_list %]"> [ +% employee_list %] </option> [% END %] </select> </td> <td> <input type = "submit" value = "Submit"/> </td> </tr> </form>
And i got the following url : http://stagingbugzilla.cpiv.com/html/centralbugzilla/output.cgi?team_id=57&fromdate=2012-05-21&todate=2012-05-30 And in my script, i used the following method to retrieve the value from url,
use CGI; my $team_id=CGI::param("team_id"); my $fromdate = CGI::param("fromdate"); my $todate = CGI::param("todate");
But i am not getting the values in my script.please help me to solve this.

Replies are listed 'Best First'.
Re: Problem in retreving value from url
by Corion (Patriarch) on Sep 03, 2013 at 12:26 UTC

    So, what do you get instead?

    When investigating this, you might want to narrow down the source of your problems. It might be incorrect data being passed into the template. It might be incorrect HTML generation in the template. It also might be incorrect reading of the form parameters. It might also be incorrect use of the form parameters afterwards.

    If you investigate the source correctly, you can eliminate one of the two code blocks you posted from the problem. This helps us help you better.

    Update: Also see Mixing POST and URL parameters in the CGI documentation.

      The problem is with my template following is my html portion:
      <html> <head> </head> <body> <div> <form name = "employee" method = "post" action = "output.cgi?team_id=[ +% team_id %]&fromdate=[% fromdate %]&todate=[% todate %]"> <!-- <p><font color="red"> Available Groups</fo +nt> </p> --> <select name = "employee" id = "emp"> <option value = ''> select </option> [% FOREACH employee_list IN employee %] <option value="[% employee_list %]"> [ +% employee_list %] </option> [% END %] </select> <input type = "submit" value = "Submit"/> </form> </div> </body> </html>
      i was looking through this and couldn't find the problem.please help

        So what is the problem there?

        Is the problem that you get the wrong output?

        What output do you get, and what output do you expect?

        Is the problem that you pass in the wrong data?

        Is the problem that the template creates the wrong output?

        Try using hidden input fields
        <form name = "employee" method = "post" action = "output.cgi"> <input type="hidden" name="team_id" value="[% team_id %]"/> <input type="hidden" name="fromdate" value="[% fromdate %]"/> <input type="hidden" name="todate" value="[% todate %]"/> ..
        poj