Larry Adamiec wrote:
I am having troubles getting started.  I have a Unix (Solaris 9)
cgi script which parses a form, processes the contents of the form,
and then sends it to a Windows ASP script for more processing and
insertion into a Access database.  I haven't been able to determine
the correct or most efficient way of sending all the form contents
to the ASP script.  In the code below, hidden_1 and hidden_2 are
only for testing.  The actual fields will number over 40 and have
labels such as first_name, last_name, email_address, etc.  The code
below does work with the two test variables.

No it does not. It results in a compilation error.

If you want help with a problem, please post a short but *complete*
program that illustrates the problem you are encountering! In this
case it probably should include the HTML form. Also, don't retype the
code, but copy and paste into the message the code you have actually
tried to execute.

I have omitted warnings and strict etc for clarity.

Bad idea. You'd better include them in order to demonstrate that you let Perl give you some basic help with debugging.

&ReadParse;

That line indicates that you are using an old library, or possibly a subroutine derived from that library, for parsing form data. It would be a good idea to replace it with e.g.:

    use CGI;
    my %in = new CGI->Vars;

Please acquaint yourself with the docs for CGI.pm:

    perldoc CGI

my $ua = LWP::UserAgent->new;

my $req = POST 'http://some_server/test2.asp',
          [ hidden_1 => 'XXaaXX',
            hidden_2 => $in{'hidden_2'}
          ];

Assuming that the form data have been stored in %in, you might be able to do something like:

    my $url = 'http://some_server/test2.asp';
    my $req = new HTTP::Request(post => $url);
    $req->content_type('application/x-www-form-urlencoded');
    $req->content( [ %in ] );

Please study the libwww-perl docs, such as:

    perldoc LWP
    perldoc lwpcook

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to