Jump to content

Storing and accessing $_GET and $_POST properties


laanes

Recommended Posts

Is this an effective way of accessing the $_GET and $_POST properties?

 

I can see that the native $_GET function has been looped through so that $varName would be for example "username" and $value would be "Jeremy". Then they are both stored into an array called $getVars?

 

Is this the best way of doing it, if not then why?

 

foreach($_GET as $varName=>$value)

 

$getVars[$varName]=trim(clean($value, 100));

 

foreach($_POST as $varName=>$value)

 

$postVars[$varName]=trim(clean($value, 100));[/code]

 

Kind regards,

laanes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.