-1
注意:未定義指數:用戶在C:\ WAMP \ WWW ---- \ testform.php上線24未定義指數:PHP
嗨可以請你幫我。 我沒有將textbox的所有名稱都聲明爲變量,這是正確的嗎?
$user = $_post['user'];
$number = $_post['number'];
$email = $_post['email'];
請問您能改正我。
<?php
$lhost = "localhost";
$user = "root";
$pss = "";
$dbn = "testarea";
$conn = mysqli_connect ($lhost,$user,$pss);
if (!$conn)
{
die("Connection Failed" .mysqli_connect_error());
}
$sdb = mysqli_select_db ($conn,$dbn);
if (!$sdb)
{
die("No Database" .mysqli_error());
}
$sqlii = "INSERT INTO person (name,contact,email) VALUES ('".$_POST['user']."','".$_POST['number']."','".$_POST['email']."')";
$sqliq = mysqli_query ($conn,$sqlii);
if (!$sqliq)
{
die("" .mysqli_error());
}
mysqli_close($conn);
?> `
<html>
<title>Test Area</title>
<body>
<form action="testform.php" method="post">
<input type="text" name="user"></br>
<input type="text" name="number"></br>
<input type="text" name="email">
<input type="submit" name="save" value="Save">
</form>
</body>
</html>
你面臨什麼樣的錯誤...解釋 –
你提交表單時是否在用戶字段上傳遞了任何數據? –