I'm doing project and it needs android-PHP-MySQL connection. I programmed PHP code, but it doesn't work. The error code says 'Undefined index: userId...' I don't know how to solve it. I googled for get some solutions but I couldn't find the right answer. Other PHP code with another android project is working. Why..?
Following is My PHP code.
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
require "init.php";
$userId = $_POST["userId"];
$username = $_POST["username"];
$userphone = $_POST["userphone"];
$usermail = $_POST["usermail"];
$userpw = $_POST["userpw"];
$sql = "INSERT INTO register_info VALUES ('$userId', '$username', '$userphone', '$usermail', '$userpw' );";
if(mysqli_query($con, $sql))
{
var_dump($userId,$username,$userphone,$usermail, $userpw );
}
?>
And this is the error code.
Notice: Undefined index: userId in /var/www/html/website/web/webapp/insertUser.php on line 9
Notice: Undefined index: username in /var/www/html/website/web/webapp/insertUser.php on line 10
Notice: Undefined index: userphone in /var/www/html/website/web/webapp/insertUser.php on line 11
Notice: Undefined index: usermail in /var/www/html/website/web/webapp/insertUser.php on line 12
Notice: Undefined index: userpw in /var/www/html/website/web/webapp/insertUser.php on line 13
string(0) "" string(0) "" string(0) "" string(0) "" string(0) ""