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

i have a problem. handle.pl and html works fine bt from handle2.pl when i proceed to handle2.pl doesn't show data from handle.pl

<form method="post" action="handle.pl"> <td>firstname</td> <td><input type="text" name="first"></td> </tr><tr> <td>lastname</td> <td><input type="text" name="last"></td> </tr><tr> <td><input type="submit"></td> </table> </form> handle.pl use CGI; use strict; my $cg = CGI->new(); my $fname = $cg->param('first'); my $lname = $cg->param('last'); print "Content-Type: text/html\n\n"; print <<HTML; <p>firstname $fname</p> <p>lastname $lname</p> <p> <input type="submit" name="button" value="Submit"> </p> HTML handle2.pl use CGI; use strict; my $cg = CGI->new(); my $fn = $cg->param($fname); my $ln = $cg->param($lname); print "Content-Type: text/html\n\n"; print <<HTML; <p>firstname $fn</p> <p>lastname $ln</p> <p> <input type="submit" name="button" value="Submit"> </p> HTML

Replies are listed 'Best First'.
Re: post and get problem
by Anonymous Monk on Nov 21, 2014 at 21:16 UTC
    Why would you expect anything else?
      what do u mean

        You should explain what you expect to happen. Maybe you can also explain why you expect things to happen.

        Also, I'm unclear on the actual flow of your program. Do you request the HTML file first, submit that to handle1.pl? How do you get from handle1.pl to handle2.pl?

        A reply falls below the community's threshold of quality. You may see it by logging in.

        Q: i have a problem. handle.pl and html works fine bt from handle2.pl when i proceed to handle2.pl doesn't show data from handle.pl

        B: Why would you expect anything else?

        C: what do u mean

        What do you think I mean? :) Did you read your own question?

        You said handle2.pl doesn't show data from handle.pl ... well, why would you expect handle2.pl to show data from handle.pl?

        Think of it this way, you walk up to a bar, and there are two bartenders, bartender-bob and bartender-bill

        You give bartender-bob money and bartender-bob gives you a drink

        You then ask bartender-bill give me a drink, and bartender-bill he says give me money, and then doesn't give you a drink

        What needs to happen for bartender-bill to give you a drink without you giving him money?