// for server side validation to check all parameters are empty or not, if one parameter value is empty it return false start
foreach ($this->input->post() as $key => $val){
$inputArr[$key] = $val;
unset($inputArr['referid']);
}
/*foreach ($_POST as $key => $val){ // for core php
$inputArr[$key] = $val;
}*/
foreach($inputArr as $key1 => $value){
if(empty($value))
{
$response = array( 'status' => 'FALSE', 'message' => 'Some parameters are missing values');
$this->set_response($response);
die;
}
}
// for server side validation end
**************************** END************************************
**************************** START**********************************
Using jQuery can set the session:
Using Jquery can set the session --> sessionStorage.setItem("rf_possesion",possesion);
get the session name --> sessionStorage.getItem("rf_possesion");
**************************** END************************************
**************************** START**********************************
POSTMAN form submit capture the form post data in controller:
$data = json_decode(file_get_contents("php://input"));
and print the data like this:
echo $data->username;
**************************** END************************************
foreach ($this->input->post() as $key => $val){
$inputArr[$key] = $val;
unset($inputArr['referid']);
}
/*foreach ($_POST as $key => $val){ // for core php
$inputArr[$key] = $val;
}*/
foreach($inputArr as $key1 => $value){
if(empty($value))
{
$response = array( 'status' => 'FALSE', 'message' => 'Some parameters are missing values');
$this->set_response($response);
die;
}
}
// for server side validation end
**************************** END************************************
**************************** START**********************************
Using jQuery can set the session:
Using Jquery can set the session --> sessionStorage.setItem("rf_possesion",possesion);
get the session name --> sessionStorage.getItem("rf_possesion");
**************************** END************************************
**************************** START**********************************
POSTMAN form submit capture the form post data in controller:
$data = json_decode(file_get_contents("php://input"));
and print the data like this:
echo $data->username;
**************************** END************************************
No comments:
Post a Comment