AJAX submission does not jump
依然是小超
依然是小超 2020-02-15 01:35:43
0
1
1092

refers to jquery-2.1.4.min.js. The data submission is successful, but the jump does not occur. Database tests are also logged.
js code function login () {$ .ajax ({type: "post", // method url: "apH/logingo.php", // The form receiving url data: $ ('#form1'). Serialize. (), Success: Function (data) {var result = document.GetelementByid ("result"); // Submit successful result.innerhtml = data [0] .Result; if (data [0] .Result == " ") {              }else if (data[0].result == " Fail ") {result.innerhtml =" & lt; a style = 'color: red' & gt; account or password error & lt;/a & gt; ";}}, error: function (data) {// Other feedback code var result = document.GetelementByid ("Result"); Result.innerhtml = "& lt; a style = 'color: red' & gt; network connection failure & lt;/a & gt;" ";";}); } PHP code & lt ;?php//error_reporting(-1);                                                                                                                                               use using              ’ ’ s to ’ s ’ ’ s ’ ’ t ‐ ‐ ‐‐‐‐ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​  $username = $_POST["username"];//Get the username from the form POST $passs = $_POST["pass"];//Get the password from the form POST//$addkey = $_POST['logcode' ]; //8-digit KEY //Form filtering $user = trim($username);//Filtering spaces $psw = trim($passs);//Filtering spaces //Start judging if($user == "" && $psw == ""){ echo "[{\"result\":\"<a style='color:red'>The account number and password are not filled in! </a>\"}]";}else if ($user == "") { echo "[{\"result\":\"<a style='color:red'>No account yet Fill in</a>\"}]";}else if ($psw == "") { echo "[{\"result\":\"<a style='color:red'>Password Not filled in yet</a>\"}]";}else{
//Verify MD5 password $md5psw = MD5($psw); include_once($_SERVER['DOCUMENT_ROOT'].'/config/ db.php'); //Link database configuration file $sql = "SELECT * FROM add_user WHERE username='$_POST[username]' and pass='$md5psw'";
$result = $db-> query($sql);$row = $result->fetch_assoc();session_start();$_SESSION['username'] = $row['username']; $_SESSION['userid'] = $row[' id'];

if ($row) { echo "[{\"result\":\"Verification successful\"}]"; }else{ echo "[{\"result\":\ "fail\"}]"; }}
?>

依然是小超
依然是小超

reply all(1)
依然是小超

I have solved it myself, thank you.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template