Solved

Post Vs. Get

Posted on 1997-05-22
4
162 Views
Last Modified: 2013-12-25
I'm writing a cgi script and posts and gets to other cgi scripts.
I know the GET command does something like this:
blah.cgi?string=value&string=value <--and so on
How does a POST work? I'm trying to manually type it in the same way and it doesn't work.. please help me.
0
Comment
Question by:chiefarcher
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
pc012197 earned 100 total points
ID: 1828064
With POST, the argument string is piped to the standard input of the CGI script. The format of the argument string is the same as in the GET command.
The command-line equivalent of a CGI call with POST is

echo "string=value&string=value..."|blah.cgi

0
 

Author Comment

by:chiefarcher
ID: 1828065
But How would I be able to post it to the browser...
would I do a
http://whatever.com?"string=value&string=value"|blah.cgi
or how would I type this?
0
 
LVL 3

Expert Comment

by:pc012197
ID: 1828066
You can't simply write it into the URL. Some servers support this (they don't really care if a request is GET or POST - they simply use both mechanisms to transfer data to the CGI script. Therefore, *sometimes* it works with a simple
http://whatever.com/blah.cgi?string=value
Ususally it doesn't, though.)

So if you want to call a CGI script with arguments you have to use a FORM with METHOD=POST.

0
 

Author Comment

by:chiefarcher
ID: 1828067
thanks pc... for my company, I'm releasing a "submit-it" type program.. The cool thing is the user only has to hit the "Submit" button one time.  The only thing I'm having problems with is server's that have "post" set up rather than "get"

thanks..
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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