Loading ...
Sorry, an error occurred while loading the content.

[PBML] passing a string to cgi

Expand Messages
  • ofer
    hello to all 1. how can i pass a string from cgi to cgi ? 2. how can i run cgi from cgi ? 3. i tryied --- exec ./time.pl but it dos t work ?
    Message 1 of 4 , Mar 13, 2000
    • 0 Attachment
      hello to all

      1. how can i pass a string from cgi to cgi ?
      2. how can i run cgi from cgi ?
      3. i tryied --- exec "./time.pl" but it dos't work ?
    • Greg Webster
      ... Send it to the cgi with an URL like: http://www.domain.com/blah.cgi?string=this%20string The %20 is required for the spaces. I m sure someone else will
      Message 2 of 4 , Mar 13, 2000
      • 0 Attachment
        On Mon, 13 Mar 2000, ofer wrote:
        > hello to all
        >
        > 1. how can i pass a string from cgi to cgi ?

        Send it to the cgi with an URL like:
        http://www.domain.com/blah.cgi?string=this%20string

        The %20 is required for the spaces.

        I'm sure someone else will jump in on the other questions.
        --
        "The world's as ugly as sin, and almost as delightful"
        - Frederick Locker-Lampson
        Greg Webster - greg@... - http://www.geekrights.org
        Public PGP key: http://www.geekrights.org/pgp/public.txt
        -------------------------------------------------------------
        LINUX DRIVER PETITION - http://www.libranet.com/petition.html
      • Jeff Boes
        ... First, CGI programs assume that they are being invoked by the web server, with a specific set of environment variables. Don t invoke them in any other
        Message 3 of 4 , Mar 13, 2000
        • 0 Attachment
          > -----Original Message-----
          > From:
          > Sent: Monday, March 13, 2000 9:21 AM
          > Subject: [PBML] passing a string to cgi

          > 1. how can i pass a string from cgi to cgi ?
          > 2. how can i run cgi from cgi ?
          > 3. i tryied --- exec "./time.pl" but it dos't work ?
          >

          First, CGI programs assume that they are being invoked by the web server,
          with a specific set of environment variables. Don't invoke them in any other
          manner unless you know what you are doing. For one, they might run in the
          wrong directory or with the wrong permissions.

          Now, if you know that a given CGI program will be invoked either from the
          command line, or from the web server as a CGI, you can write it to take
          appropriate action. For example, you can look at @ARGV to see what's on the
          command line, if anything.

          If you just invoke it with exec, it will inherit whatever environment
          variables (like QUERY_STRING) the caller had. You could set those to
          whatever you wanted, e.g.,

          $ENV{QUERY_STRING} = 'param1=something¶m2=something%20else';
          exec './time.pl';

          Another way is to make use of the LWP package, which should be available on
          your server if you have a fairly recent installation of Perl. The absolutely
          easiest way to run a CGI from a CGI is:

          use LWP::Simple;

          $content = get('http://some.server.com/cgi-bin/my.cgi');

          ----
          "The future masters of technology will have to be lighthearted and
          intelligent. The machine easily masters the grim and the dumb."
          --Marshall McLuhan
          ___________________
          Jeff Boes <>< jboes@...
          Mur Consulting http://www.qtm.net/~jboes/
        • ofer r
          ok that is nice but it dosn t work for me my problem is that i need to sava string like username=o and password=12 i wont my script to know what is the user
          Message 4 of 4 , Mar 15, 2000
          • 0 Attachment
            ok that is nice but it dosn't work for me

            my problem is that i need to sava string like username=o and
            password=12
            i wont my script to know what is the user name & password .

            1.how can i do that with qury_string , with out making my site to a
            "get" site ? can i setup the qury_string with out the "get" method
            $ENV{QUERY_STRING} = 'username=o&password=12' dosn't work.

            2.how can i do exec if i have to put in the file "location=" or
            print"Content-type:text/html\n\n";?




            "jeff boes" <jboe-@...> wrote:
            original article:http://www.egroups.com/group/perl-beginner/?start=220
            >
            >
            > > -----Original Message-----
            > > From:
            > > Sent: Monday, March 13, 2000 9:21 AM
            > > Subject: [PBML] passing a string to cgi
            >
            > > 1. how can i pass a string from cgi to cgi ?
            > > 2. how can i run cgi from cgi ?
            > > 3. i tryied --- exec "./time.pl" but it dos't work ?
            > >
            >
            > First, CGI programs assume that they are being invoked by the web
            server,
            > with a specific set of environment variables. Don't invoke them in
            any other
            > manner unless you know what you are doing. For one, they might run in
            the
            > wrong directory or with the wrong permissions.
            >
            > Now, if you know that a given CGI program will be invoked either from
            the
            > command line, or from the web server as a CGI, you can write it to
            take
            > appropriate action. For example, you can look at @ARGV to see what's
            on the
            > command line, if anything.
            >
            > If you just invoke it with exec, it will inherit whatever environment
            > variables (like QUERY_STRING) the caller had. You could set those to
            > whatever you wanted, e.g.,
            >
            > $ENV{QUERY_STRING} = 'param1=something¶m2=something%20else';
            > exec './time.pl';
            >
            > Another way is to make use of the LWP package, which should be
            available on
            > your server if you have a fairly recent installation of Perl. The
            absolutely
            > easiest way to run a CGI from a CGI is:
            >
            > use LWP::Simple;
            >
            > $content = get('http://some.server.com/cgi-bin/my.cgi');
            >
            > ----
            > "The future masters of technology will have to be lighthearted and
            > intelligent. The machine easily masters the grim and the dumb."
            > --Marshall McLuhan
            > ___________________
            > Jeff Boes <>< jboes@...
            > Mur Consulting http://www.qtm.net/~jboes/
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.