Oh yeah.. I'm totally confused! Happens often.. don't worry. Eventually I'll go "OH.. that's what you meant!"
Okay.. the reason I'm lost is because at first I thought you wanted to code in your counter and include it somehow on your scripts that you are already using. I think I'm realizing now that all you wish to do is try the SSI method. Is this right?
My server does let me call a CGI with SSI,
Firstly if your server requires you to change your extension to .shtml inorder for SSI to parse correctly on your pages, I'll bet to bottoms that you cannot parse SSI within a CGI script. Just a guess. Or else you could just easily insert your SSI tag within your generated header/footer file.
I'm not familar with the codings of Gossamer Links, so I'm not very helpful on that.. in fact I'm not being helpful at all, I feel like a dork 'cause I can't for the life of me see what you're doing.
generating a .shtml page and then dynamically filling the ID with a form tag.
Why do you want to do this? Curious. From what I can see you already have the ID number's filled in: ex: detail.cgi?ID=5038
I know you can specify contents of a form (like a textfield) by using ?textfield=whatever, but could I use a hidden field in the SSI call to pull the correct ID?
Under normal circumstances, there is a program at the other end that reads the output from the get/post (Query_String), that will manipulate what has been entered from let's say the textfield. SSI (Server Side Includes) is only a convenient method to insert things such as the time, files, or to execute a cgi program etc... where your server reads this information and if correct, it will insert whatever it is you're calling. Therefore, you can't input a hidden field (not that I know of) that will insert your new ID tag from SSI alone. However you could try to code a program that reads either the query string from your ID page that the SSI tag is inserted then manipulate the code to replace the SSI tag with whatever it is you want.
Now does that sound confusing.

Just to reiterate.. all you want to do is put a counter on your cgi pages right?