<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script> jQuery(document).ready(function(){ jQuery("#wp_login_submit").click(function(){ var login = {}; login["wp_login_username"] = jQuery("#wp_login_username").val(); login["wp_login_password"] = jQuery("#wp_login_password").val(); login = JSON.stringify(login); jQuery.ajax({ type: 'POST', url: '/portal/login.php', dataType: 'text', data: {'login' : login}, success: function(response){ var result = JSON.parse(response); if(typeof result["id"] != "undefined"){window.location.href = "/customer/"; }else{document.getElementById("errorlogin").innerHTML = result["error"] ;}/*var result = JSON.parse(response);window.location.href = "/customer/" ;*/ }, error: function(xhr, status, error){ alert("Error!" + xhr.status); } }); }) }); </script> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous"><form id="wp_login" method='POST'>
<div class="form-group">
<label for="Email address">Email address</label>
<input type="email" class="form-control" id="wp_login_username" name="wp_login_username" aria-describedby="emailHelp">
<small id="emailHelp" class="form-text text-muted">Your email associated with WindsweptMarketing</small>
</div>
<div class="form-group">
<label for="Password">Password</label>
<input type="password" class="form-control" id="wp_login_password" name="wp_login_password">
</div>
<input id="wp_login_submit" class="btn btn-danger" type="button" value="Login"/>
</form> </div>