PDA

View Full Version : Sending data between perl pages


Kickin
07-01-2005, 05:45 AM
I'm having some problems with sending data between perl pages.

I have a form.htm that sends the data to a preview.pl page using a javascript form with post method. This data sends fine, however I want to send the same data from the preview.pl to a logdata.cgi page. The page executes fine, but the data does not send. (It is set up to send "data1,data2,data3" - what I get is ",,,") I'm probably missing something small (possibly the way the variables are declared?) since I'm new to perl. I would greatly appreciate any help or suggestions I can get.

mlseim
07-01-2005, 01:47 PM
You need to send it like:

logdata.cgi?data1=orange&data2=purple&data3=black

With a question mark followed by ampersands between variables.

Within the logdata.cgi script, you take in the variables:
#!/usr/bin/perl

use CGI ':standard';

$data1 = param('data1');
$data2 = param('data2');
$data3 = param('data3');