Hello,

I'm still not finding what i'm doing wrong here...If anyone can help, I'd
more than appreciate it...here's a quick refresher...if my method = "get",
my submit button does nothing (doesn't call my cgi and error out or
anything)...however, if i change it to method = "post", it calls my cgi
program.

Have you looked at your logs? I suspect that this is a problem with your HTTP server configuration.


Some background:

The major difference between GET and POST is the way that data is submitted. Back in the good ol' days, web servers only served out static documents. You'd say "I want a document called /path/index.html" (or whatever) and it'd send back that document. This is called the GET method. A browser sends the following to the server:

GET /path/index.html

The server responds with the contents of index.html.

Later, someone said "hey, here's a neat idea... what if we designed a way for a web server to call a program so that the contents of a page could be built with program logic!" the problem was, there was no way to send input to that program. So they came up with the idea of encoding data into the URL itself. This way, they could continue to use the GET method, but it would provide information to the program.

For example, if the web browser sent the following request:
GET /cgi-bin/myprogram?purrate=A&wcommcd=MC

From the browser's perspective, this is still just a static HTML request.
The browser and the network protocol don't have to change. The server is modified slightly to know that "?" separates the program name from the variables, but that's all.

As things got more sophisticated, they started having length problems with URLs. Most browsers & servers had a limit to how long the URL on the GET request could be, and that limits how much data can be sent this way.

So they fixed that by actually changing the protocol. They added the ability to upload data to the program, like a file transfer, rather than encoding the data into the URL. This is called a POST request.


So, that's the difference between GET and POST. GET tacks stuff onto the URL where POST does a file transfer. The symptom of your problem is that your program DOESN'T GET CALLED when a GET request is done.


Hmmm... the URL is being changed and your program doesn't get called... that's interesting, isn't it?

The reason that's interesting is that HTTP servers allow you to specify expressions to determine how paths are mapped from the URL sent by the browser to find the physical object on disk. If the modified GET URL doesn't work with the particular expression you've put in your configuration, it would explain the exact symptom that you've described...

That's why I suggest looking at your logs. When a request fails and you have error & access logging turned on, you should be able to get a glimpse into how the server is interpreting that request. For example, maybe it's adding ".pgm" to the end of the request, resulting in

 GET /cgi-bin/myprogram?purrate=A&wcommcd=MC.PGM

That might not be the exact problem, but it might be SOMETHING like that... Check your logs to see what's happening.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.