naveed010 has asked for the wisdom of the Perl Monks concerning the following question:
Most gracious of monks.
I've written a small input form for a local charity, I decided to use CGI::Ajax as a learning experience for myself.
However, I feel ashamed and am having a complete BrainFart, and have gotten to the point of forgetting how to do the simplest. I'm making a small stupid mistake here and I can't see it.
When the user hits "submit" the fields are passed to a sub in another file, using CGI::Ajax. However, I keep getting an error stating
CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers
It is obviously telling me there's something wrong with my paramaters, however doing something as simple as this:
#!/usr/bin/perl sub insertVals { my $str="num:".scalar(@_); for(my $i=1;$i<scalar(@_);$i++) { $str=$str."<p>$_"; } return $str; }
... returns the CGI error. If I simply do this:
#!/usr/bin/perl sub insertVals { return "num:".scalar(@_); }
It displays num:10 as expected.
Lastly, here's the code that's calling the procedure:
insertVals(['pTD','pLocation','p1','p2','p3','p4','p5','pNum','pGameNo +tes','pGameId'], ['dbPostDiv'] );
I'm stuck in a loop here and need help out. I am wondering if anyone encountered this before? Should I check and see if the paramater is undefined? And, as always, if anyone knows of a better way, I'm all ears.
Thanks in advance. I shall sacrifice the wings of chickens and bottles of ale in appreciation of any help. :)
Additional thoughts... Using CGI::Ajax, how can I retreive the entire http string that's passed to the perl function ie: http://www.mysite.com/ajax.pl?param1=balh¶m2=bwagh.... etc..
Thanks again.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI::Ajax and passing the paramaters.
by toolic (Bishop) on May 06, 2008 at 18:31 UTC | |
by naveed010 (Acolyte) on May 07, 2008 at 17:36 UTC | |
|
Re: CGI::Ajax and passing the paramaters.
by Anonymous Monk on May 13, 2008 at 12:22 UTC |