PHP重新发送验证电子邮件

时间:2013-10-04 01:42:03

标签: php login-script

我正在尝试使用tampus login system向我的登录/注册系统添加重新发送验证操作。我正在关注this tutorial

1 个答案:

答案 0 :(得分:-3)

好吧我不是php框架的粉丝所以我会用MySQL为你做这个:

if(empty($_POST["user"]) || empty($_POST["pass"])){
    echo "Missing values";
} else {
  //You would need the mysql connection variable named $db_conn
  $db_conn = mysqli_connect("localhost","user","pass","db_name");
  $user = $_POST["user"];
  $pass = md5($_POST["pass"]);//MD5 encrypt;

  $sql = "SELECT id FROM users WHERE username='$user' AND password='$pass'"
  $query = mysqli_query($db_conn,$sql);
  if(mysql_num_rows($query) > 1){
    //Do the login thingys like cookies and redirects
  } else {
    echo "Check your credentials";
  }
}

我认为我无法更容易理解