ScriptBasic

Support => General Discussions => Topic started by: RONB on October 20, 2011, 12:18:02 PM

Title: delete post please
Post by: RONB on October 20, 2011, 12:18:02 PM
info not helpful to others, please delete post, thanks
Title: Re: cgi module
Post by: Support on October 20, 2011, 02:38:24 PM
Ron,

I normally set environment variables with the SYSTEM or EXECUTE SB command. Are you starting your CGI scripts using the scriba -c command to tell SB that the script is CGI based?

Quote
CGI programs gain a great wealth of information from environment variables. This data is available to the ScriptBasic program via module functions. The CGI program is encouraged to use these functions instead of the function environ(). The reason to use these functions is that later versions of the CGI module may support ISAPI, NSAPI, FastCGI and other web server interface modes. Calling the function environ() to get the value of these variables will not work in that case, while calling the functions provided by the CGI module still works.

John

Update

Quote
.htaccess files are reread upon every hit within that directory. In fact, the web server will look for these .htaccess files on every access to the web server.

If using Apache, you may be able to set your environment variable by creating a .htaccess file in the directory your script is running and add the following.

SetEnv HTMLDOC_NOCGI "1"

Title: Re: cgi module
Post by: Support on October 20, 2011, 09:39:23 PM
After my previous post I gave the .htaccess method a try and it worked fine. That should be a quick way to solve your issue.

In general, how are your adventures going with ScriptBasic?

Title: Re: cgi module
Post by: Support on October 21, 2011, 06:45:58 AM
Another way to set CGI environment variables is to specify them as either GET or as POST parameters in the http request.
Title: Re: cgi module
Post by: Support on October 21, 2011, 06:36:12 PM
Ron,

I'm trying to understand what you're after. I assumed that you're sending  a request to a non-SB page/script that is looking for a special environmental variable to be set. Can you be more specific what you're trying to accomplish?

John

P.S.

Thanks for your feedback about SB.