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.
#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