我找不到這是重試錯誤404的原因。我將此代碼放入表單元素的action屬性中。我真的對PHP很陌生,所以如果你發現有任何破壞腦的東西,那麼很抱歉。正在檢索錯誤404
<form method="post" action="<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
// Create connection
$con = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
//Inputed in E-Mail Field
$Mail = $_POST['email'];
//Search for Mail
$sql = ("SELECT Mail FROM betakey WHERE Mail = '$Mail'");
$result=mysqli_query($con,$sql);
mysqli_close($sql);
//If Mail is already registered
if (mysqli_num_rows($result) > 0) {
echo "This email is already registered. Wait for the Beta Key!";
mysqli_close($con);
mysqli_free_result($result);
}
//Inserting Mail when its not registered
?>">
<input type="email" id="email" name="email" placeholder="Type your E-mail Address here" value="<?= isset($_POST['email']) ? htmlspecialchars($_POST['email']) : '' ?>"required="required"/>
<input name="submit" type="submit" value="Sign Up" id="SignUpButton"/>
</form>
此代碼無法檢索404錯誤。向我們顯示調用此代碼的表單。 –
添加了表單本身。 – KillZoneZ
您的所有PHP代碼都是* not *在表單的操作中,是嗎?如果是,請將您的PHP代碼放在單獨的文件中,並將該文件名稱用作表單中的操作。 –