Link | lp_client_param |
Author | Bil Corry |
Category | Client |
Version | 8.x |
License | Public Domain |
Posted | 23 Dec 2005 |
Updated | 30 Oct 2006 |
More by this author... |
Returns the value of a client GET/POST parameter.
Requires [lp_client_params], [lp_logical_between]
lp_client_param:'hello';
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:'lp_client_param', -description='Returns the value of a client GET/POST parameter.', -priority='replace', -required='param', -optional='index', -optional='method', -optional='count'; // save error so we won't overwrite it with our protect below local:'_ec' = error_code; local:'_em' = error_msg; lp_error_clearError; if: !(local_defined:'method'); local:'method' = 'both'; /if; local:'param_count' = (lp_client_params: #method)->(find: #param)->size; if: (local_defined:'count'); // restore the error, if any error_code = #_ec; error_msg = #_em; return: #param_count; /if; if: #param_count == 0; // restore the error, if any error_code = #_ec; error_msg = #_em; return: string; /if; protect; handle: true; if: error_code != (error_noerror: -errorcode); // restore the error, if any error_code = #_ec; error_msg = #_em; return: string; /if; // restore the error, if any error_code = #_ec; error_msg = #_em; /handle; if: (local_defined:'index'); if: (lp_logical_between: (integer:#index), 1, #param_count); return: (lp_client_params: #method)->(find: #param)->(get: (integer:#index))->value; else; return: string; /if; /if; local:'return' = array; iterate: (lp_client_params: #method)->(find: #param), local:'p'; #return->(insert: #p->value); /iterate; #return = #return->(join:'\r'); if: #return->size == 0; return: string; else; return: #return; /if; /protect; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft