Monday, March 3, 2008

Retrieve data from $_POST array

/**
* Retrieve PHP Post variable
*/
reset ($_POST);
while (list ($key, $val) = each ($_POST))
{
if ($val){
addslashes($val);
$$key = $val;
$_SESSION['data_advertiser'][$key] = $val;
}
}

so let say you have $_POST['name']. After this code to access this variable , what you have to do is just use $name instead of $_POST['name'] !!! so easy right?

0 comments: