4D v12.4

SET CGI EXECUTABLE

Home

 
4D v12.4
SET CGI EXECUTABLE

 

SET CGI EXECUTABLE 


 

SET CGI EXECUTABLE ( url1 {; url2} ) 
Parameter Type   Description
url1  String in Access URL
url2  String in Access URL

The SET CGI EXECUTABLE command executes a CGI without it being visible to the Web user in the URL. This command can be used more particularly in the On Web Authentication Database Method to determine, for example, which CGI to execute. It operates both under Mac OS X and Windows.

Note: For more information about CGIs, refer to the Using CGIs section.

In url1, pass the access URL for the CGI to be executed. For example, if you write SET CGI EXECUTABLE("/myfile.pl"), the 4D Web server executes the CGI myfile.pl — this application must be located in the default folder of the Web server.

If you pass an empty string ("") in url1, 4D executes the CGI specified in the URL sent by the browser directly, where applicable.

In the optional url2 parameter, pass the access URL for the file that you want to be processed by the CGI. For example, if you write SET CGI EXECUTABLE("cgi-bin/Perl2.cgi";"Perl2.pl"), the Web server executes the CGI Perl2.cgi (located in the cgi-bin folder) by passing it the Perl2.pl file.

If you pass an empty string ("") in url2, 4D passes the file specified in the URL sent by the browser to the CGI for processing. This mechanism is used more particularly by PHP. Example: SET CGI EXECUTABLE("/cgi-bin/php";"").

If the access URL indicated by the command is incorrect, the browser displays the “File not found” error page.

Keep in mind that the SET CGI EXECUTABLE command does not return an error directly. This command only sets a “current value” that is used subsequently when the CGI is called. In the event of multiple calls with this command, only the value indicated by the last call is used. 

Example  

In this example, the example.php file, which is not located in the cgi-bin folder, is processed by the CGI Perl2.cgi, located in the cgi-bin folder:

 SET CGI EXECUTABLE("/cgi-bin/Perl2.cgi";"example.php")

 
PROPERTIES 

Product: 4D
Theme: Web Server
Number: 813

 
HISTORY 

Created: 4D 2004

 
SEE ALSO 

Using CGIs