what is param() in CGI PERL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdshafi01
    New Member
    • Jan 2008
    • 36

    what is param() in CGI PERL

    HI,

    I have problem in this code

    it is not working it is not going insdie param condition...

    please what will be the problem

    please help me

    [code=perl]
    use CGI qw(:standard);

    print "Content-type: text/plain\n\n";

    if (param()) {
    my $dest = param('dest');
    my $opt = param('opt');
    my $file = param('file');
    my $user = param('user');

    print "\n-->$dest $opt $file $user\n";
    if ($file =~ /Z$/) {
    `zcat $file | lp -d$dest -t $user $opt `;
    } else {
    `lp -d$dest -t $user $opt $file `;
    }
    ##Added by Ram K Maddela for deleting files from Server after Printer...
    `rm -f $file`;
    }
    [/code]
    Last edited by numberwhun; Feb 5 '08, 12:55 PM. Reason: add code tags
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    I would add the following this will tell you what params the script is seeing.

    Before this section of code:
    [CODE=perl]if (param()) {
    my $dest = param('dest');
    my $opt = param('opt');
    my $file = param('file');
    my $user = param('user');[/CODE]

    Add this section of code:
    [CODE=perl]foreach my $key (param) {
    print "<strong>$k ey</strong> -> ";
    my @values = param($key);
    print join(", ",@values),"<br >\n";
    }[/CODE]

    --Kevin

    Comment

    • mdshafi01
      New Member
      • Jan 2008
      • 36

      #3
      Can any one tell me how to execute this CGI script.

      what are the configurations are required. and where to place this script. and any link or something is required for webserver or something.


      shafi

      Comment

      • eWish
        Recognized Expert Contributor
        • Jul 2007
        • 973

        #4
        If you don't know how to execute the script then how do you know that the param() are not being set?

        Since you are running is as CGI you will need a webserver.

        --Kevin

        Comment

        • mdshafi01
          New Member
          • Jan 2008
          • 36

          #5
          I need details like where to keep this perl script.

          what are the webervers are required for my program.
          is it required to create any link between my program and webserver

          please tell me those details

          shafi

          Comment

          • numberwhun
            Recognized Expert Moderator Specialist
            • May 2007
            • 3467

            #6
            Originally posted by mdshafi01
            I need details like where to keep this perl script.

            what are the webervers are required for my program.
            is it required to create any link between my program and webserver

            please tell me those details

            shafi

            Well, assuming that you will be using the Apache web server, here is a tutorial for setting it up. That should tell you what you need to know.

            Regards,

            Jeff

            Comment

            Working...