-5
<?php
$con = mysqli_connect("localhost", "KyleLongrich", "Cash7144") or die('could not connect to server');
mysqli_select_db($con,"kylelongrich") or die("could not connect to database");
if(isset($_POST['Send']))
{
$Firstname = strip_tags($_POST['firstname']);
$Lastname = strip_tags($_POST['lastname']);
$Email = strip_tags($_POST['email']);
$Topic = strip_tags($_POST['topic']);
$Message = strip_tags($_POST['message']);
$sql = "INSERT INTO emailquestions (Firstname, Lastname, Email, Subject, Message) VALUES ('$Firstname','$Lastname','$Email','$Topic','$Message')";
mysqli_query($con, $sql);
echo $FirstName;
}
?>
<div class="contact-forum">
<form action="Test2.php" method="post">
<input type="text" name="firstname" placeholder="FirstName"> <br />
<input type="text" name="lastname" placeholder="LastName"> <br />
<input type="text" name="email" placeholder="E-mail"> <br />
<input type="text" name="topic" placeholder="Topic"> <br />
<input type="text" name="message"> <br />
<input type="submit" name="Send">
</form>
</div>
它給我這個錯誤:PHP POST方法不能正常工作
「通知:未定義的變量:姓在C:\ XAMPP \ htdocs中\ myfiles的\ Test2.php第22行」
第22行是指「echo $ FirstName;」
我一直盯着這個幾個小時,任何幫助都會很棒。
哇我笨謝謝 –
戰勝飢餓國家聯盟。一直髮生在我身上。首先想到這些可能性只是一個經驗問題。 –