php - Required parameters -



have problem when trying access registration page of application. use php version 7.0.5.
url : http://localhost/project/registration.php
params : name, email , password
unfortunatelly got error message required parameters (name, email or password) missing!
code :

$registration = new user(db_host, db_user, db_password, db_database);  // json response $response = array("error" => false);  $name = (isset($_post['name'])) ? $_post['name'] : false; $email = (isset($_post['email'])) ? $_post['email'] : false; $password = (isset($_post['password'])) ? $_post['password'] : false;  if (isset($name) && isset($email) && isset($password)) {      //$name = $_get['name'];     //$email = $_get['email'];     //$password = $_get['password'];      // check if user existed same email     if ($registration->isuserexisted($email)) {         // existed         $response["error"] = true;         $response["error_msg"] = "user existed " . $email;         echo json_encode($response);     } else {         $user = $registration->storeuser($name, $email, $password);         if ($user) {             // user stored             $response["error"] = false;             $response["uid"] = $user["unique_id"];             $response["user"]["name"] = $user["name"];             $response["user"]["email"] = $user["email"];             $response["user"]["created_at"] = $user["created_at"];             $response["user"]["updated_at"] = $user["updated_at"];             echo json_encode($response);         } else  {             // user failed store             $response["error"] = true;             $response["error_msg"] = "unknown error occurred in registration!";             echo json_encode($response);         }     }  } else {     $response["error"] = true;     $response["error_msg"] = "required parameters (name, email or password) missing!";     echo json_encode($response); } 

could me ? why got error.

$_post set, content might empty.

$var = '';  // evaluate true text printed. if (isset($var)) {     echo "this var set print."; } 

as epodax mentioned try using var_dump();


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -