[client_params_9]

Description

Link: [client_params_9]
Author: Jolle Carlestam
Category: Client
Version: 9.x
License: Public Domain
Posted: Oct. 13, 2009
Updated: Jan. 01, 0001
More by this author...
Returns a static array of GET/POST parameters passed from the client. An optional param "method" can direct it to return only post or get params. Inspired by Bil Corrys 8.5 tag lp_client_params.

Parameters

-method string, optional Returns only get or post params if defined

Sample Usage

client_params;
client_params('post');
client_params(-method = 'get');
						

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
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?LassoScript
/**
Returns a static array of GET/POST parameters passed from the client.
An optional param "method" can direct it to return only post or get params
Example usage:
client_params;
client_params('post');
client_params(-method = 'get');

Inspired by Bil Corrys 8.5 tag lp_client_params.

*/
define client_params(-method::string = '')::staticarray => {

	return client_params(#method);

}
define client_params(method::string = '')::staticarray => {

	if(#method != 'GET' && #method != 'POST');
		// return both
		local(temp = client_getparams -> asarray);
		#temp -> merge( client_postparams -> asarray);
		return(#temp -> asstaticarray);
	/if;

	if(client_formmethod >> 'GET' && #method != 'POST');
		return(client_getparams);
	else(client_formmethod >> 'POST' && #method != 'GET');
		return(client_postparams);
	else;
		return(staticarray);
	/if;

}


?>

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net