如何验证表单字段到数据库

这个问题在这里已经有了答案:

  • 基于表单的网站身份验证的权威性指南[已关闭] 12个答案

  • 我认为它应该工作

    $usernamename = $_GET['usernamename'];
    $code = $_GET['code'];
    $email = $_GET['email'];
    $res = mysql_query("SELECT * FROM `table` WHERE `usernamename` = '$usernamename' AND  `code` = '$code' AND  `email` = '$email'  LIMIT 1 ") or die(mysql_error());
    if($row = mysql_fetch_assoc($res))
    {
        header("location:index.php");
        exit;
    }
    
    链接地址: http://www.djcxy.com/p/3721.html

    上一篇: How to Validate Form fields to database

    下一篇: How can i turn this into a secure log in?