LampPi

 

Code


PHP: Loading GET or POST data


...
$lp = new lamppi_class();
$action = $lp->setAction();
...

public function setAction() {
# initialization
$action = "";

# Try to find action
if (trim($_POST['action'])){
# POST
$action = trim($_POST['action']);
}elseif (trim($_GET['action'])){
# GET
$action = trim($_GET['action']);
}else{
# Use default
$action = "";
}

# Return action
return $action;
}

Note: $_POST and $_GET are pre-populated PHP global variables.


About

Contact

Links

Site Map

© LampPi 2018