Start cgi executable immediately without using meta tag?

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
Spud2004
-


Joined: 12 Sep 2004
Posts: 29

PostPosted: Sun Sep 12, 2004 8:46 am    Post subject: Start cgi executable immediately without using meta tag? Reply with quote

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 View user's profile Send private message
Spud2004
-


Joined: 12 Sep 2004
Posts: 29

PostPosted: Fri May 05, 2006 1:21 am    Post subject: Reply with quote

<img src="/cgi-bin/program.exe?chkpass.htm" height="0" align="right">
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri May 05, 2006 10:54 am    Post subject: Re: Start cgi executable immediately without using meta tag? Reply with quote

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 View user's profile Send private message Send e-mail
Spud2004
-


Joined: 12 Sep 2004
Posts: 29

PostPosted: Fri May 05, 2006 3:19 pm    Post subject: Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group