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

[PBML] Re: passing a string to cgi

Expand Messages
  • 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 1 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.