[setHTTPstatus]

Description

Link: [setHTTPstatus]
Author: Johan Sölve
Category: Technical
Version: 6.x
License: Public Domain
Posted: Feb. 15, 2006
Updated: Sep. 06, 2006
More by this author...
Custom tag to set HTTP status. Replaces the status code but keep leading HTTP with version as well as the rest of the HTTP header.

Parameters

-statuscode string, required The new status code and status message

Sample Usage

[setHTTPstatus: '404 Not Found']
						

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.
1
2
3
4
5
6
7
<?lassoscript
define_tag: 'setHTTPstatus', -required='statuscode';
	$__http_header__ = (string_replaceregexp: $__http_header__,
		-find='(^HTTP\\S+)\\s+.*?\r\n',
		-replace='\\1 ' + #statuscode + '\r\n');
/define_tag;
?>

 

Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net