Forum Moderators: open
I am using a cgi program called cgi-exec which allows you to use a hidden INPUT field with the name REF_DOC and a value for a script. It then does blackbox switching and can be used to run shell scripts to parse the data.
However, when I open the new window it runs the script but none of the data from the form for the hidden fields get passed. Thanks!
Here is the code for my form:
<form method="post" style="margin-bottom:0" action="/cgi-bin/cgi-exec.cgi">
<input type=hidden name=REF_DOC value=edit_entry.html>
<input type=hidden name=acl_entry value="test:user">
<input type="image" src="/images/edit_button.gif" height="19" width="47" border=0 alt="Edit Entry" onClick="window.open('/cgi-bin/cgi-exec.cgi','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=350,height=300'); return false;">
</form>
I hope i did understand you, correct me if i'm wrong:
If this is the situation, it happens because you send the parameters in (3) off to the CGI from the calling page and not from the popup. In the popup you call the CGI without these parameters:
window.open('/cgi-bin/cgi-exec.cgi','',..') If you want the results to display in the popup, you must call the CGI with the parameters from the popup. You are currently using a POST, so if you can change to a GET request, it will be quite easy to pass the parameters in the URL:
window.open('/cgi-bin/cgi-exec.cgi?REF_DOC=edit_entry.html&acl_entry=test:user','',..') Hope this helps.
/claus
Thanks for the info. Unfortunatly I tried your suggestion and the program cgi-exec which I am using does not utilize command line input.
It may not be possible with the was I have it coded to send the values from the hidden INPUT fields to the cgi script and open a new window. But I haven't given up hope yet!
Thanks for your time!
Regards,
Jason
- and also info on freshmeat that the commandline-option is defunct since 1.2.1. (i didn't mean commandline anyway). It should support both GET and POST though. I think this is the key (quote from manpage):
REF_DOC should be set as indicated above, with the value being the name of the referring HTML document.
An easy way to test is to change the POST you already have in your code to GET and then submit. In order to get the results to display in the popup window, you simply have to call it from a page that loads there. This can be done in a few ways, one example is javascript:
IN YOUR FORM:
--------------
window.open('/popup-page.html','',..')
--------------
IN NEW PAGE (called: popup-page.html)
--------------
<html>
<head>
<META HTTP-EQUIV="refresh" CONTENT="0;
URL="/cgi-bin/cgi-exec.cgi?REF_DOC=popup-page.html&acl_entry=test:user">
</head>
<body onLoad="javascript:window.location.href='/cgi-bin/cgi-exec.cgi?REF_DOC=popup-page.html&acl_entry=test:user'">If you can see this text, please <a href="/cgi-bin/cgi-exec.cgi?REF_DOC=popup-page.html&acl_entry=test:user">click here to display results in stead</a>
</body></html>
--------------
There's three different calls to the CGI in this small html file, i believe at least one should do the trick.
/claus