本文整理汇总了PHP中CI_Input::post方法的典型用法代码示例。如果您正苦于以下问题:PHP CI_Input::post方法的具体用法?PHP CI_Input::post怎么用?PHP CI_Input::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CI_Input
的用法示例。
在下文中一共展示了CI_Input::post方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function employee_login(CI_Input $input)
{
$ci = get_instance();
$ci->load->model('Employees');
$result = $ci->Employees->employee_login($input->post('employeenumber'), $input->post('password'));
if (isset($result) && count($result) != 0) {
$ci->session->set_userdata(array('employeenumber' => $result[0]->EmployeeNumber, 'campaignid' => $result[0]->Campaignid, 'department' => $result[0]->Department, 'positionid' => $result[0]->PositionID));
employee_redirect($result[0]->Department);
} else {
return "Employee is either inactive or does not exist.";
}
}
示例2: index
public function index()
{
$items = $this->input->post('items');
$data = $this->vaola->prepareData($items);
try {
$this->vaola->sync($data);
$message = 'Saved';
} catch (\Exception $exc) {
$message = $exc->getMessage();
}
$args = ['message' => $message, 'boxes' => count($data)];
$this->load->view('layout/header.php');
$this->load->view('page/save', $args);
$this->load->view('layout/footer.php');
}
示例3: post
function post($index = '', $xss_clean = FALSE)
{
if($index === '')
return ($_SERVER['REQUEST_METHOD'] === 'POST');
return parent::post($index, $xss_clean);
}
示例4: post
/**
* {@inherit}
*/
public function post($index = NULL, $xss_clean = NULL)
{
if ($this->mock_state) {
return $this->_fetch_from_array($this->mock_POST, $index, $xss_clean);
}
return parent::post($index, $xss_clean);
}
示例5: post
function post($index = '', $xss_clean = FALSE)
{
if ($index === '') {
$return = $_POST ? TRUE : FALSE;
return $return;
}
return parent::post($index, $xss_clean);
}
示例6: post
public function post($index = null, $xss_clean = TRUE)
{
if (!$xss_clean) {
//if asked for raw post data -eg. post('key', false)-, return raw data. Use with caution.
return $this->_POST_RAW[$index];
}
return parent::post($index, $xss_clean);
}
示例7: post
public function post($index = NULL, $xss_clean = NULL, $default_value = NULL)
{
$value = parent::post($index, $xss_clean);
if (empty($value) && $default_value !== NULL) {
$value = $default_value;
}
return $value;
}
示例8: post
/**
* @param null $index
* @param bool $xss_clean
* @param null $default_value
* @return array|null|string
*/
function post($index = NULL, $xss_clean = FALSE, $default_value = NULL)
{
$ret_val = parent::post($index, $xss_clean);
if ($ret_val === false && isset($default_value)) {
$ret_val = $default_value;
}
return $ret_val;
}
示例9: register
public function register()
{
$data = $this->input->post(['email', 'password']);
$response = $this->moneyzaurus->userRegister($data['email'], $data['password']);
if ($response['code'] == 200) {
if (!$response['data']['success']) {
$this->session->set_flashdata('message', $response['data']['message']);
redirect('');
}
$message = sprintf('Hi %s', $response['data']['data']['email']);
$this->session->set_flashdata('message', $message);
if ($this->loginCustomer($data['email'], $data['password'])) {
redirect('/transaction');
}
}
redirect('');
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->load->model('user_model');
$this->load->helper('url_helper');
$input = new CI_Input();
$this->params = array_merge($input->get(), $input->post());
$this->checkLogin();
}
示例11: post
function post($index = '', $xss_clean = FALSE)
{
// this will be true if post() is called without arguments
if ($index === '') {
return $_SERVER['REQUEST_METHOD'] === 'POST';
}
// otherwise do as normally
return parent::post($index, $xss_clean);
}
示例12: save
public function save()
{
$data = $this->input->post(['id', 'item', 'group', 'price', 'date']);
if (!empty($data['id'])) {
$response = $this->moneyzaurus->transactionsUpdate($data['id'], $data['item'], $data['group'], $data['price'], 'EUR', $data['date']);
} else {
$response = $this->moneyzaurus->transactionsAdd($data['item'], $data['group'], $data['price'], 'EUR', $data['date']);
}
if ($response['code'] == 200) {
if (!$response['data']['success']) {
$this->session->set_flashdata('message', $response['data']['message']);
} else {
$data = ['success' => $response['data']['data']['id'], 'date' => $data['date']];
}
redirect('/transaction?' . http_build_query($data));
}
$this->session->set_flashdata('message', 'Error');
redirect('/transaction?' . http_build_query($data));
}
示例13: __construct
public function __construct()
{
parent::__construct();
//$this->load = load_class('Loader', 'core');
//$this->load->initialize();
$this->load->model('user_model');
//$/this->load->helper('url_helper');
//$this->user_model = new User_Model();
//load_class('');
$input = new CI_Input();
$this->params = array_merge($input->get(), $input->post());
}
示例14: declineConnection
public function declineConnection()
{
$id = $this->input->post('id');
$response = $this->moneyzaurus->connectionReject($id);
if ($response['code'] == 200) {
if (!$response['data']['success']) {
$this->session->set_flashdata('message', $response['data']['message']);
} else {
$this->session->set_flashdata('message', 'Connection rejected');
}
}
redirect('/profile');
}
示例15: setStringDataFromPost
/**
* @param $object
* @param $fieldNames
*/
protected function setStringDataFromPost(&$object, $fieldNames)
{
if (isset($this->ModelName) && !is_null($this->ModelName) && $this->ModelName !== '') {
if (is_array($fieldNames) && count($fieldNames) > 0) {
foreach ($fieldNames as $fieldName) {
if (class_exists($this->ModelName) && property_exists($this->ModelName, $fieldName)) {
$value = addslashes($this->security->xss_clean($this->input->post(strtolower($fieldName))));
$object->{'set' . $fieldName}($value);
}
}
}
}
}