cgi-perl

Hello Friends,

I have written a cgi-bin/perl script.
I need some help to complete this task.

I have 3 pop up ment and My scenario is like:

1st pop up: 1 2 3
2nd pop up: A B C
3rd pop up: ls cd ps

When we will select 1 then the A ans ls should be selected automatically and 2 B cd....

How can we do this?

Your input is highly helpful for me!!

Comments

  • : Hello Friends,
    :
    : I have written a cgi-bin/perl script.
    : I need some help to complete this task.
    :
    : I have 3 pop up ment and My scenario is like:
    :
    : 1st pop up: 1 2 3
    : 2nd pop up: A B C
    : 3rd pop up: ls cd ps
    :
    : When we will select 1 then the A ans ls should be selected
    : automatically and 2 B cd....
    :
    : How can we do this?
    :
    : Your input is highly helpful for me!!
    :
    :


    Ok, so no one replied????

  • Since you've already written some of it, you might want to post what you have so people can look at what you are doing. It sounds to me like you are trying to pass variables to 3 different forms. If you are doing that, you can use hidden variables in your cgi to pass them along:



    and use variables to store the form data:

    my $selection = param('selection');

    if ($selection ne "") {
    take them to step 2
    }

    If you just want one form to change 2 other variables that's different.
    if ($selection =~ /1/) {
    $pop2 = "A";
    $pop3 = "ls";
    }
    if ($selection =~ /2/) {
    $pop2 = "B";
    $pop3 = "cd";
    }

  • #!/usr/bin/perl

    use CGI;
    # File: time1.pl
    use CGI ':standard';
    $current_time = localtime;
    #
    print header,
    start_html('A Virtual Clock'),
    h1('A Virtual Clock'),
    "The current time is $current_time.",
    hr,
    end_html;

    $base_address = '/www/jshankar/search';
    $base_url = 'http://xyz.com/~abc/search';

    $co = new CGI;

    if ($co->param()) {

    $BuildExecute = $co->param('BuildExecute');
    }

    print $co->header,

    $co->start_html
    (
    -title=>'CGI Example',
    -author=>'Shankar',
    -meta=>{'keywords'=>'CGI Perl'},
    -BGCOLOR=>'pink',
    -LINK=>'green'
    ),

    $co->center
    (
    $co->h1
    (
    'Welcome CGI-BIN Script!'
    )
    ),

    $co->center
    (
    $co->h2
    (
    'IGT Script'
    )
    ),

    "Please enter your password: ",

    $co->p,
    $co->password_field

    (
    -name=>'password',
    -default=>'open sesame',
    -size=>30,

    ),

    "you might be interested in ",

    $co->a({href=>"http://www.cpan.org/"},"CPAN"), ".",

    $co->hr,

    $co->start_form
    (
    -name=>'form1',
    -method=>'POST',
    -action=>"http://IP/manual/mod/core.html#documentroot"
    ),

    "Please check the script you want to execute: ",

    $co->p,

    $co->center
    (
    $co->checkbox_group
    (
    -name=>'checkboxes',
    -values=>['Products','Build File','Go']
    )
    ),

    $co->p,

    $co->hidden
    (
    -name=>'BuildExecute',
    -override => 1,
    -default => $BuildExecute
    ),

    $co->p,

    $co->center
    (
    $co->submit('Add to Build Execute'),
    $co->reset,
    ),

    $co->p,

    $co->hr,

    $co->end_form,

    $co->start_form
    (
    -name=>'form2',
    -method=>'POST',
    -action=>"http://xyz.com:8080/navbar/"
    ),

    $co->hidden
    (
    -name=>'BuildExecute',
    -override => 1,
    -default => $BuildExecute
    ),

    $co->center
    (
    $co->submit('Go to Build Script Location'),
    ),

    $co->end_form,

    $co->start_form
    (
    -name=>'form3',
    -method=>'POST',
    -action=>"http://www.iciciprulife.com/public/default.htm"
    ),

    $co->hidden
    (
    -name=>'BuildExecute',
    -override => 1,
    -default => $BuildExecute
    ),

    $co->center
    (
    $co->submit('See Your Build Status'),
    ),

    $co->p,

    "Please select the numbers: ",

    $co->p,

    $co->popup_menu
    (
    -name=>'popupmenu',
    -value=>['Blank','1','2','3','4'],
    'Blank',
    ),

    $co->p,

    "Please select the Alphabets: ",

    $co->p,

    $co->popup_menu
    (
    -name=>'popupmenu',
    -value=>['Blank','A','B','C','D'],
    'Blank',
    ),

    $co->p,

    "Please select the command: ",

    $co->p,

    $co->popup_menu
    (
    -name=>'popupmenu',
    -value=>['Blank','ls','mkdir','cat','cd'],
    'Blank',
    ),

    $co->p,

    "Please select the dir path: ",

    $co->p,

    $co->popup_menu
    (
    -name=>'popupmenu',
    -value=>['Blank','/home/test','/home/test/newdir'],
    'Blank',
    ),

    $co->p,
    (
    $co->submit('Submit'),
    $co->reset,
    ),

    $co->p,

    "Please enter your opinion: ",

    $co->p,

    $co->textarea
    (
    -name=>'textarea',
    -default=>'No opinion',
    -rows=>10,
    -columns=>60
    ),

    $co->p,

    "Thank you for submitting Build. Please indicate how
    much unsolicited mail you like to get: ",

    $co->p,

    $co->popup_menu
    (
    -name=>'popupmenu',
    -values=>['Very much','A lot','Not so much','None'],
    ),

    $co->p,

    $co->hidden
    (
    -name=>'hiddendata',
    -default=>'Rosebud'
    ),

    $co->p,
    (
    $co->submit('Submit'),
    $co->reset,
    ),

    $co->start_html("Check if someone is logged in"),

    $co->center
    (
    $co->h1("Check if someone is logged in...")
    ),

    $co->p,
    $co->start_form,

    $co->center
    (
    "Please enter the person's login name: ",

    $co->textfield('person'),

    $co->p,
    $co->submit('Check'),
    $co->reset
    ),
    $co->end_form;

    if ($person = $co->param('person')) {

    foreach (`who`) {

    if (/^$persons/) {

    print
    $co->center
    (
    $co->h2
    (
    "Yes, $person is logged in.",
    )
    ),
    $co->end_html;

    exit;
    }
    }

    print
    $co->center
    (
    $co->h2
    (
    "$person is not logged in, sorry.",
    )
    );
    }

    $co->end_form,

    $co->end_html;
    ___________________________________

    Above are the codes I have written, It's my first script, so I don't have much knowledge, how to process?
    Using this script I want to execute the the script which is on the other system.

    Kindly help me to resolve the issue.

    Thanks -


  • I am in urgent need to finish it.
    please help me to complete this task.

    I will be so kind of you.

    Thanks-
  • Hello Friends,

    I urgent need to finish this task.
    Kindly help me.

    I will be thankful to you.

    Thanks-

  • Hello Friends,

    I urgent need to finish this task.
    Kindly help me.

    I will be thankful to you.

    Thanks-

  • Check your forum mailbox.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories