Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > dump POST data to screen

Reply
Thread Tools

dump POST data to screen

 
 
henribaeyens
Guest
Posts: n/a
 
      02-15-2008
Hello,

I'm trying to figure out a way to output, for debugging purposes, the
contents of a multipart form-data. The posted data consists of both text
type inputs and file types input. In php, one can invoke print_r($_POST)
and print_r($_FILES), how do I achieve this using perl, especially for
the $_FILES data; I can do the $_POST by parsing the query string but how
do I do it for the files?

Thanks much for any help

Henri
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-15-2008
henribaeyens wrote:
> I'm trying to figure out a way to output, for debugging purposes, the
> contents of a multipart form-data.


print <STDIN>;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
 
henribaeyens
Guest
Posts: n/a
 
      02-15-2008
On Fri, 15 Feb 2008 18:16:38 +0100, Gunnar Hjalmarsson wrote:

> henribaeyens wrote:
>> I'm trying to figure out a way to output, for debugging purposes, the
>> contents of a multipart form-data.

>
> print <STDIN>;


nice guru ****!

I managed to come up with

while(<STDIN>) {
chomp($_);
print "$_<br>\n";
}

thanks

 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-15-2008
henribaeyens wrote:
> On Fri, 15 Feb 2008 18:16:38 +0100, Gunnar Hjalmarsson wrote:
>> henribaeyens wrote:
>>> I'm trying to figure out a way to output, for debugging purposes, the
>>> contents of a multipart form-data.

>>
>> print <STDIN>;

>
> nice guru ****!
>
> I managed to come up with
>
> while(<STDIN>) {
> chomp($_);
> print "$_<br>\n";
> }


You didn't mention that you are using a CGI script to inspect the data.
It's not advisable to display unparsed form data as HTML. If you are
using a browser, try this instead:

print "Content-type: text/plain\n\n", <STDIN>;

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
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
Dump complete java VM state as core dump (not via OS) possible? halfdog Java 12 02-21-2013 06:14 AM
Re: How do I do a screen dump? Pen Computer Information 1 02-09-2010 10:38 PM
blue screen help dump inside jazzzjackrabbit General Computer Support 0 04-10-2008 03:19 PM
Screen Dump The Man Computer Support 8 05-23-2005 10:22 PM
Post post post. Shel-hed Computer Support 2 11-08-2003 07:41 AM



Advertisments