gpt4 book ai didi

php - 在 php 中重复发送电子邮件以获取注册表单

转载 作者:行者123 更新时间:2023-11-29 08:17:14 25 4
gpt4 key购买 nike

如何在此代码中添加重复功能以进行电子邮件重复?

我有检查电子邮件的功能是否已存在于数据库中,但我想再次使用电子邮件功能来重新输入电子邮件。我怎样才能在我的代码中做到这一点。谁能帮我吗?

<?php 
include("includes/connect.php");

if(isset($_POST['submit'])) {
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];
$... = $_POST['...'];

if($...=='') {
echo"<script>alert('please enter the ...')</script>";
exit();
}
if($...=='') {
echo"<script>alert('please enter the ...')</script>";
exit();
}
if($...=='') {
echo"<script>alert('please enter the ...')</script>";
exit();
}
if($...=='') {
echo"<script>alert('please enter the ...')</script>";
exit();
}

$check_... = "SELECT * FROM ... where ...='$...'";
$run = mysql_query($check_...);
if(mysql_num_rows($run)>0) {
echo "<script>alert('... $... is alredy exist in database , please try other ...')</script>";
exit();
}

$query ="INSERT INTO ... (...,...,..., ...,...,...,...,...,...) VALUES ('$...','$...','$...', '$...','$...','$...','$...','$...,'$...')";

if(mysql_query($query)) {
echo "<script>alert('Registiration was succesfully!')</script>";
}
}
?>

最佳答案

我希望这不是生产代码,因为代码具有潜在的 SQL 注入(inject)(请检查此 What is SQL injection? )。但无论如何关于你的问题。您需要添加简单的检查来实现您想要的:

    ...

if($business_name == ''){
echo"<script>alert('please enter the usernme')</script>";
exit();
}
if($email == ''){
echo"<script>alert('please enter the email')</script>";
exit();
}

//check for matching
if($email != $emailagain){
echo"<script>alert('entered email addresses don't match')</script>";
exit();
}
$check_email = "SELECT * FROM ... where ...='$...'";
...

关于php - 在 php 中重复发送电子邮件以获取注册表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20363840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com