我的代碼:PHP錯誤:這些php代碼有什麼問題?它說未定義指數誤差
$name=$_POST["name"];
這是錯誤
Notice: Undefined index: name in /home/u615903880/public_html/reg3.php on line 4
code :
<?php
$con = new mysqli("xxxxx", "xxxx", "xxxx");
$name = $_POST["name"];
$username = $_POST["username"];
$emailaddress = $_POST["emailaddress"];
$password = $_POST["password"];
$statement = mysqli_prepare($con, "INSERT INTO users (name, username, emailaddress, password)VALUES (?,?,?,?)");
mysqli_stmt_bind_param($statement, "ssss", $name, $username, $emailaddress, $password);
mysqli_stmt_execute($statement);
$response = array();
$response["success"] = true;
echo json_encode($response);
mysqli_stmt_close($statement);
mysqli_close($con);
?>
Error lines 4,5,6,9,10,14
也許有像'name'無後的項目? –
嘗試檢查您的元素的名稱是:name –