Exemplo n.º 1
0
                            break;
                        }
                    }
                }
            } else {
                $errors[3] = "<font color='red'>*** Your Password Cannot be numeric ***</font>";
            }
        } else {
            $errors[3] = "<font color='red'>*** Your Password MUST be 7 characters? ***</font>";
        }
    } else {
        $errors[3] = "<font color='red'>*** Your Password? ***</font>";
    }
}
if (isset($_POST["submit"])) {
    chkinput();
    if ($errors[0] == "" && $errors[1] == "" && $errors[2] == "" && $errors[3] == "") {
        $myCon = mysqli_connect("localhost", "root", "", "gamebuydb");
        if (mysqli_connect_errno()) {
            printf("connection failed: %s\n", mysqli_connect_error());
            exit;
        } else {
            $Lname = trim($_POST["lname"]);
            $Password = trim($_POST["password"]);
            $sql = "Select * From customertbl Where cust_lname = '" . $Lname . "' And cust_passw = '" . $Password . "'";
            $res = mysqli_query($myCon, $sql);
            if ($res) {
                if (mysqli_num_rows($res) == 0) {
                    $FistName = trim($_POST["fname"]);
                    $LastName = trim($_POST["lname"]);
                    $Email = trim($_POST["email"]);
Exemplo n.º 2
0
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $_name = mysql_real_escape_string($_POST['name']);
    $_yinbiao = mysql_real_escape_string($_POST['yinbiao']);
    $_epn = mysql_real_escape_string($_POST['epn']);
    $_eg = mysql_real_escape_string($_POST['eg']);
}
$isRight = $nameErr == "" && $epnErr == "";
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $isRight) {
    $sql = "select * from bibi_word where '{$_name}' = spell";
    #echo $sql . "<br />";
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        echo "Sorry, word had been added." . "<br />";
    } else {
        #echo $_POST['name'] . $_POST['yinbiao'] . $_POST['epn'] . $_POST['eg'];
        if ($_POST['eg'] != "" && !chkinput($_POST['eg'])) {
            echo "Eg Invalid Input , " . "<br />";
            echo "Square bracket should be used to cover the eg." . "<br />";
            echo "If there is more than one eg , you should seperate them with square bracket." . "<br />";
            echo "Here is the example:" . "<br />";
            echo "[this is a example for eg input.][这是一个例子输入的举例。]";
        } else {
            $add = "insert into bibi_word (spell, yinbiao, epn, eg) \n\t\t\t\tvalues('{$_name}', '{$_yinbiao}', '{$_epn}', '{$_eg}')";
            #echo $add . "<br />";
            mysql_query($add) or die("insert Error. " . mysql_error());
            #在log文件中添加纪录
            $fin = fopen("../log/addWord.txt", 'a');
            if (!$fin) {
                echo "file to log add word doesn't exists!" . "<br />";
                exit;
            }