Click to See Complete Forum and Search --> : href link where ?id=something


ptf451
02-24-2005, 12:02 PM
Hi Gang, I have an in-house web site that searches articles of information, among other things. In its simplest form the html page is just a form submission:

<HTML>
<HEAD><TITLE>In-House Web Control ID Search</TITLE>
</HEAD>
<BODY>
<P>To search, fill in your desired ISBN. Then click on the Search button (or press Enter).
<FORM NAME="ctrlidform" METHOD="POST" ACTION="../cgi-bin/ctrlid.cgi">
<P>
<B>Enter Control ID #:</B>&nbsp;&nbsp;&nbsp;
<INPUT TYPE="TEXT" WIDTH="140" NAME="ctrlid">
&nbsp;&nbsp;&nbsp;<INPUT TYPE="SUBMIT" VALUE="Search"></FORM>
</BODY>
</HTML>

The CGI script simply submits the search value to a backend database, which looks up the item, builds a quick html page and presents it. If the search is a number, then it searches by number. If it is a word or words, then it searches by word. This methodology works fine in-house.

Now, an outside agency would like access to this search capability by using the following link:

<A HREF="http://mywebsite/controller.html?ctrlid=123456">

I am trying to test this functionality in-house, but can't get it to work. When I submit the form, it works fine, but if I use the link in the web address, it does not work. Any suggestions???

Thanks a lot.

bokeh
02-24-2005, 12:27 PM
The form uses the "POST" method of sending data while the "?id=something" method uses "GET" and looks a lot more untidy in the URL department. You could change the form to GET and make subsequent changes in the CGI or the other party could use "POST".

NogDog
02-24-2005, 01:05 PM
What Bokeh said. One way or another you'll have to edit the CGI program unless you get the other users to use a form-based HTML request that uses the POST method. If the URL GET method is a must, then you'll either want to change both your original form and the CGI script to use the GET data, or else add logic to the CGI script to look for either the POST or GET ctrlid variable, then for the other if it doesn't find it.