这就是我希望它在数据库中查找电子邮件的方式,如果它确实出现并打个招呼,这封电子邮件正忙着尝试不同的或类似的。
我期望:它会来找出在我的数据库中找到的电子邮件,如果确实如此,它必须给用户一个答案。
如果它在数据库中不存在,它只是正常创建用户。
现在将其设置为 0,数据库中没有电子邮件或看起来像,但它仍然说电子邮件已注册,但如果我输入 1 代替 0,那么我可以创建尽可能多的电子邮件。
}
else
{
$email_1 = $_post["email"];
$result = $this->mysqli->query("SELECT * FROM `bruger` WHERE email='$email_1'");
if(mysqli_num_rows($resut) > 0)
{
$pb = null;
include "fun_filer/img/class.upload.php";
$handle = new Upload($_FILES["file"]);
if($handle->uploaded)
{
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->image_y = 75;
$handle->image_x = 75;
$handle->Process("images/bruger");
$pb = $handle->file_dst_name;
}
if($stmt = $this->mysqli->prepare("INSERT INTO `bruger` (`rank`, `email`, `adgangskode`, `navn`, `efternavn`, `profil_img`) VALUES (?, ?, ?, ?, ?, ?)"))
{
$stmt->bind_param('isssss', $rank, $email, $adgangskode, $navn, $efternavn, $profil_img);
$rank = 1;
$email = $_POST["email"];
$adgangskode = sha1($_POST["password_adgangskode_1"]);
$navn = $_POST["fornavn"];
$efternavn = $_POST["efternavn"];
$profil_img = $pb;
$stmt->execute();
$navn = $_POST["navn"];
$til = $_POST["email"];
$password = $_POST["password_adgangskode_1"];
$fra = "Hello.com - Opret bruger <" . "info@hello.com" . ">";
$til = $_POST["email"];
$emne = "Velkommen til Hello.com";
$besked = file_get_contents('mail_opret.php');
$besked = str_replace("%%navn", $navn, $besked);
$besked = str_replace("%%brugernavn", $til, $besked);
$besked = str_replace("%%password", $password, $besked);
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=UTF-8 \n";
$headers .= "From: " . $fra . "\n";
mail($til, $emne, $besked, $headers);
?>
<div class="article-main-content">
<div class="alert-message" style="background-color:#77b01e;"><span class="icon-text">✓</span><span class="alert-content">Din bruger er blevet opret og du få en email fra os <a href="#" class="destroy-button"></a></div>
</div>
<?php
$stmt->close();
}
else
{
echo 'Der opstod en fejl i erklæringen: ' . $this->mysqli->error;
}
}
else
{
?>
<div class="article-main-content">
<div class="alert-message" style="background-color:#c22525;"><span class="icon-text">⚠</span><span class="alert-content">Email Findes på hjemmesiden</span><a href="#" class="destroy-button"></a></div>
</div>
<?php
}
}
}
当我把它放在 1 上时,输入和一切都非常好。