Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl, javascript and CGI

Reply
Thread Tools

Perl, javascript and CGI

 
 
Saya
Guest
Posts: n/a
 
      09-05-2003
Hi,

I have the following scenario in a system that we run. From a webpage
using javascript I am able to invoke a *.ipl script on the server and
pass parameters as well:

javascript param parsing:
parameters = new Object();
parameters.iw_arrArtikelIDs = arrArtikelsToExtract;
callServer("test.ipl", parameters, true);

*.ipl param extraction:
my${cgi} = new CGI();
my $arrArtikelIDs = ${cgi}->param('iw_arrArtikelIDs');

The issue here is that arrArtikelsToExtract is a java array containing
ID's that I need to process in the *.ipl script. I can't seem to get
it to work.
I thought I was so lucky that I could get away with saying something
like the below in the *.ipl script:
my @arrArtikelIDs = ${cgi}->param('iw_arrArtikelIDs');

Does anyone have any hints/clues/way(s) of achieving this. Parsing an
array from javascript to an ipl script ?
 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      09-05-2003
Hi Saya,

I am not an expert at these things but you might want to try this perl
code to get hold of the parameters. It does not require you to specify
the parameters by name

######Get the data from the form
my $query = new CGI;
my @keywords = $query->param;
my $sizeKeywords = @keywords;

#####put key value pairs returned from form into a hash
my %values;
foreach my $val(@keywords){
$values{$val} = $query->param("$val");
}

If its the javascript that is not operating as expected, what about
using a document.write statement to write a form action url with
keyvalue pairs attached or to write hidden inputs within the form with
each value of the array in a seperate input?

Hope that helps,

Mark



On 5 Sep 2003 06:03:52 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Saya) wrote:

>Hi,
>
>I have the following scenario in a system that we run. From a webpage
>using javascript I am able to invoke a *.ipl script on the server and
>pass parameters as well:
>
>javascript param parsing:
>parameters = new Object();
>parameters.iw_arrArtikelIDs = arrArtikelsToExtract;
>callServer("test.ipl", parameters, true);
>
>*.ipl param extraction:
>my${cgi} = new CGI();
>my $arrArtikelIDs = ${cgi}->param('iw_arrArtikelIDs');
>
>The issue here is that arrArtikelsToExtract is a java array containing
>ID's that I need to process in the *.ipl script. I can't seem to get
>it to work.
>I thought I was so lucky that I could get away with saying something
>like the below in the *.ipl script:
>my @arrArtikelIDs = ${cgi}->param('iw_arrArtikelIDs');
>
>Does anyone have any hints/clues/way(s) of achieving this. Parsing an
>array from javascript to an ipl script ?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(CGI-Target)Could not connect to CGI-Proxy John Smith Java 0 05-15-2006 09:21 PM
cgi and cgi-bin zippy Perl Misc 5 02-02-2005 01:46 AM
Python CGI - Accepting Input, Invoking Another Process, Ending CGI LarsenMTL Python 4 11-04-2004 05:59 PM
Calling cgi from cgi thru 'system' function. Different behaviour on browser v/s cmd line Shailan Perl 2 12-15-2003 04:26 PM
Re: CGI Perl "use CGI" statement fail Jürgen Exner Perl 0 07-31-2003 02:00 PM



Advertisments