Saturday, September 5, 2009

how to stuff data right down a cgi-bin script's throat

The web page URL is just a /index.cgi, with a form to change the content but the URL doesn't change.

The answer to crafting a URL for the page I want is to look at the source for the form, find the name-value pair and add that onto the end of the URL thusly: /index.cgi?name=value. It took several tries to find the name, and to remember to use the question mark. Websites that led me to the answer were:

This is the head of about 4 linked pages that explain CGI in a lot more detail, and had the answer but I didn't get it: http://www.cs.cf.ac.uk/Dave/PERL/node227.html

This site is very directly worded, and gave the clue that I should read the FORM source for tags labeled INPUT, SELECT, or TEXTAREA (for my case it was SELECT) to get the name of the name-value pair.http://jmarshall.com/easy/cgi/

For the format of passing the name-value pairs (ironically, a gsfc website having almost nothing to do with CGI tutorials): http://idlastro.gsfc.nasa.gov/idl_html_help/Passing_NameValue_Pairs_in_a_URL.html