Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Keeping Values Perl CGI

by Sylense (Initiate)
on Aug 15, 2009 at 00:21 UTC ( [id://788788]=perlquestion: print w/replies, xml ) Need Help??

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

Hi All, I'm completely new to CGI scripting and I'm running into a difficult issue. I'm passing in values via the URL (http://www.blah.com?name=mike)

I have this variable as a field...
my $name = param("name");

I also have boolean statements that will issue different sub-routines based on user input...

if(param('action') eq 'Yes') { &delete; #this will delete the value in "name" } elsif(param('action') eq "No') { &keep; #this will keep the value in "name" } else { &print_form; #this prints the initial screen }

The print_form basically asks the user "Do you want to delete 'name'?" and it has 2 submit buttons, yes and no. I can't seem to keep the value that I put in the URL for name after a button is clicked. Can anyone help? Thanks in advance!

Replies are listed 'Best First'.
Re: Keeping Values Perl CGI
by Anonymous Monk on Aug 15, 2009 at 01:17 UTC
      Anonymous Monk is pointing you in the right direction.

      You may also want to consider CGI::Application as a way to organize your code.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://788788]
Approved by markjugg
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-26 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found