httpリクエスタを使用しています。 /エンコードされた値は、値を受け入れることができるブラウザを介しています。httpリクエスタを使用して私はキーと値を送信することができますが、同じURL /エンコードされた値をブラウザで送信しているときに値を受け入れることができました
エラー:
Notice: Undefined index: email in filepath/filename.php on line 7
Notice: Undefined index: password in filepath/filename.php on line 8
Notice: Undefined index: username in filepath/filename.php on line 9
Notice: Undefined index: age in filepath/filename.php on line 10
Notice: Undefined index: gender in filepath/filename.php on line 11
Notice: Undefined index: address in filepath/filename.php on line 12
Notice: Undefined index: city in filepath/filename.php on line 13
Notice: Undefined index: country in filepath/filename.php on line 14
Notice: Undefined index: pincode in filepath/filename.php on line 15
Notice: Undefined index: mobile in filepath/filename.php on line 16
Notice: Undefined index: roleid in filepath/filename.php on line 17
{"status":"error","message":"Missing required field"}
マイコード:以下 thrwingエラー
<?php
require("Conn.php");
require("MySQLDao.php");
$email = $_POST["email"];
$password = $_POST["password"];
$username = $_POST["username"];
$age = $_POST["age"];
$gender = $_POST["gender"];
$address = $_POST["address"];
$city = $_POST["city"];
$country = $_POST["country"];
$pincode = $_POST["pincode"];
$mobile = $_POST["mobile"];
$roleid = $_POST["roleid"];
$returnValue = array();
if(empty($email) || empty($password) || empty($username) || empty($pincode) || empty($gender) || empty($mobile))
{
$returnValue["status"] = "error";
$returnValue["message"] = "Missing required field";
echo json_encode($returnValue);
return;
}
$dao = new MySQLDao();
$dao->openConnection();
$userDetails = $dao->getUserDetails($email);
if(!empty($userDetails))
{
$returnValue["status"] = "error";
$returnValue["message"] = "User already exists";
echo json_encode($returnValue);
return;
}
$secure_password = md5($password); // I do this, so that user password cannot be read even by me
$result = $dao->registerUser($email,$secure_password,$username,$age,$gender,$address,$city,$country,$pincode,$mobile,$roleid);
if($result)
{
$returnValue["status"] = "Success";
$returnValue["message"] = "User is Registered";
echo json_encode($returnValue);
return;
}
$dao->closeConnection();
?>
解決エラー[ 'メール'];? – Devendra