Link | client_host |
Author | Johan Solve |
Category | Client |
Version | 6.x |
License | Public Domain |
Posted | 15 Feb 2006 |
Updated | 06 Sep 2006 |
More by this author... |
This tag returns the host name from the visitor's request header. Useful for example to implement virtual hosts functionality in Lasso.
[client_host]
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.
(replace: '\r\n', '\r'); #requestheader -> (replace: '\n', '\r'); #requestheader = #requestheader -> (split: '\r'); iterate: #requestheader, (local: 'headerfield'); if: #headerfield -> (beginswith: 'Host:'); #output=#headerfield; #output -> (removeleading: 'Host:'); #output -> trim; loop_abort; else: #headerfield -> (beginswith: 'HTTP_Host:'); // try to find header field modified by IIS (all fields are prefixexd by HTTP_) #output=#headerfield; #output -> (removeleading: 'HTTP_Host:'); #output -> trim; loop_abort; /if; /iterate; return: #output; /define_tag; ?>
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft