Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CGI - Echo of Post Data - Environment Variables

Posted on 2000-05-08
3
Medium Priority
?
435 Views
Last Modified: 2013-12-25
I used to have a site that I could bounce my http form (post) request against and it would return a page that would include all the cgi environment variables -- in addition to the post string of form variables.  
That site is no longer live.  Can anyone give me an URL which does the same thing?     (or a vbscript .ASP which I can run on my IIS server?)

Thanks!
0
Comment
Question by:gorndog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Expert Comment

by:hualian
ID: 2790684
Give you a script:
This is URL:
http://alleasy.net/cgi-bin/getform.pl

make sample form code:

<FORM method="POST" action="http://alleasy.net/cgi-bin/getform.pl">
  <P><INPUT type="text" name="T1" size="20"><INPUT type="submit" value="submit" name="B1"><INPUT type="reset" value="reset" name="B2"></P>
</FORM>

if you have any problem, please say.


This is Source code of getform.pl:

#!/usr/bin/perl
use CGI;
$hoyi=new CGI;

print $hoyi->header;
print $hoyi->start_html('CGI Enviroment!');
## Print all you post var
print $hoyi->dump;
## print all Env var
print "\n<pre>\n";
foreach (keys(%ENV)) {
      print "$_ = $ENV{$_} \n";
}
print "\n</pre>";
exit;

0
 

Accepted Solution

by:
hualian earned 300 total points
ID: 2790706
Give you a script:
This is URL:
http://alleasy.net/cgi-bin/getform.pl 

make sample form code:

<FORM method="POST" action="http://alleasy.net/cgi-bin/getform.pl">
  <P><INPUT type="text" name="T1" size="20"><INPUT type="submit" value="submit" name="B1"><INPUT type="reset" value="reset" name="B2"></P>
</FORM>

if you have any problem, please say.


This is Source code of getform.pl:

#!/usr/bin/perl
use CGI;
$hoyi=new CGI;

print $hoyi->header;
print $hoyi->start_html('CGI Enviroment!');
## Print all you post var
print $hoyi->dump;
## print all Env var
print "\n<pre>\n";
foreach (keys(%ENV)) {
      print "$_ = $ENV{$_} \n";
}
print "\n</pre>";
exit;



0
 

Author Comment

by:gorndog
ID: 2791195
That URL doesn't list the string of "post data".  The reason I wanted that is so that I can put into my html a single link that does the exact same thing as the form post would do.  Thus if I can see the post string that the browser issues when I click on the form's submit, then I will know what my link needs to say.

The URL you provide does have a line for "QUERY_STRING" .., which shows what I would want for a "GET" request, but the URL doesn't show the form variables like that if it is a "POST" request.

That perl could probably be tweaked to generate the equivalent POST DATA into a string ..., but I did a bit more searching and found this URL:

http://www.neosoft.com/neowebscript/tests/environment.html

It handles both GET and POST requests.

Thanks so much for your answer and Perl script -- they both came in very handy!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question