Lasso Soft Inc. > Home

[server_type]

Linkserver_type
AuthorJason Huck
CategoryUtility
Version8.x
Licensehttp://opensource.org/licenses/artistic-license.php
Posted18 Nov 2006
Updated05 Feb 2007
More by this author...

Description

Returns the type of web server as reported in the HTTP response header.

Sample Usage

[server_type]

-> 'Apache/1.3.33 (Darwin) PHP/5.1.2 JRun/4.0'

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define_tag(
	'type',
	-namespace='server_',
	-priority='replace',
	-description='Returns the type of web server as reported in the HTTP response header.'
);
	null(
		include_url(
			'http' + (server_port == 443 ? 's') + '://127.0.0.1' + ((: 80, 443) !>> server_port ? ':' + server_port) + '/robots.txt', 
			-retrievemimeheaders='__temp_header'
		)
	);

	// reset any web server errors from the include_url above
	// that may have bubbled up into a Lasso error
	error_code = 0;
	error_msg = 'No error';

	protect;
		local('out') = $__temp_header->find('Server')->first->second;
		
		handle_error;
			local('out') = 'undefined';
		/handle_error;
	/protect;
	
	var_remove('__temp_header');
	
	return(#out);
/define_tag;

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft