View previous topic :: View next topic |
Author |
Message |
Spud2004 -
Joined: 12 Sep 2004 Posts: 30
|
Posted: Sun Sep 12, 2004 8:46 am Post subject: Start cgi executable immediately without using meta tag? |
|
|
Wondered if a cgi exe could be started without having to meta HTTP-EQUIV="Refresh" Content="0; URL=http://mysite.com/cgi-bin/start.exe">
Wondered if an executable could be started instead of index.html
This would allow page to appear a little faster and some environment variables such as referred by might not be lost. I create most pages
using executable cgi's written with PB/CC http://www.powerbasic.com |
|
Back to top |
|
|
Spud2004 -
Joined: 12 Sep 2004 Posts: 30
|
Posted: Fri May 05, 2006 1:21 am Post subject: |
|
|
<img src="/cgi-bin/program.exe?chkpass.htm" height="0" align="right"> |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri May 05, 2006 10:54 am Post subject: Re: Start cgi executable immediately without using meta tag? |
|
|
Spud2004,
If the executable is to be called immediately after the page downloading, why not having it directly referenced?
You could add start.exe in the Index Files table and put start.exe in the directory where it should act as the index file. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
Spud2004 -
Joined: 12 Sep 2004 Posts: 30
|
Posted: Fri May 05, 2006 3:19 pm Post subject: |
|
|
That works great and is much easier!
I was incorrect about IMG SRC rerouting browser.
However, it is useful for calling a cgi program anywhere without rerouting
the browser to another page.
Code: |
#COMPILE EXE
%CREATE_PAGE = 2 ' 0 = route browser 1 = display page 2 = call without rerouting
'Instead of using STDOUT WriteCGI suggested in PBCGI.INC
FUNCTION PBMAIN AS LONG
#IF %CREATE_PAGE = 0
STDOUT "LOCATION: http://www.powerbasic.com"
#ELSEIF %CREATE_PAGE = 1
STDOUT "Content-type: text/html" + $CRLF
STDOUT "Welcome " + ENVIRON$("REMOTE_ADDR") + _
" from port " + ENVIRON$("REMOTE_PORT")
#ELSEIF %CREATE_PAGE = 2 'display image or execute a program without rerouting
STDOUT "Content-type: text/html" + $CRLF
STDOUT "<img src = 'http://website99.com/cgi-bin/mycgiprogram.exe'>"
#ENDIF
STDOUT ""
END FUNCTION |
|
|
Back to top |
|
|
|