Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call a CGI script with parameters?

Status
Not open for further replies.

TheMojo

IS-IT--Management
May 22, 2002
6
US
I am in dire need of calling a CGI script (i.e. message.cgi) that resides in an executable sub-directory called /cgi-bin from my index.htm file. The challenge is that I need to call this script on the page load AND to pass it parameters that have to be extracted from the URL for the site.

For example:

1. A user has clicked on a link that looks like this
2. As the index.htm file for noworkzone.com loads, it needs to parse the source parameter value from the URL and call the message.cgi script WITH the 1201 parameter (the CGI script resides in the /cgi-bin subdirectory)

3. Once it has successfully called the CGI script, the page simply continues loading (the CGI script in question has no effect on the webpage, rather it just ads some statistics to a flat file).

Is this possible? Are there any problems with calling an executable during page load? Does the fact that the CGI script resides in a sub-directory present any problems?

Any and all tips are greatly appreciated... If you have some sample code that would be awesome too!
 
Try opening a separate window, as small as you can make it, and blur() it. Then document.write() a form to that window with the CGI file as the action, include the data you need to, and submit the form. You'll need to have the CGI script close the window then. This would keep it from affecting the main page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top