Let's see ... according to the comments I would have to edit the thread, but no matter how much I do it ...
I have to send a json per post, and when sending it I would have to receive one in which I would say if the login is correct or incorrect.
Here the login form:
<form name="login" action="">
<input type="text" id="email" placeholder="User">
<input type="password" id="pass" placeholder="Password">
<button type="submit" id="send" onclick="sendForm()">Enter</button>
<div class="moreoptions">
<div class="ico">
<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
<a href="#">I forgot my password</a>
</div>
<div class="ico">
<span class="glyphicon glyphicon-save" aria-hidden="true"></span>
<a href="#">Register</a>
</div>
</div>
</form>
And this is the javascript function that calls when you hit the button #send
function sendForm(){
var fpU = ROT47(document.forms[0].elements[0].value);
var fpP = ROT47(document.forms[0].elements[1].value);
var objJSON = {
pfd: "login",
fpU: fpU,
fpP: fpP,
browserInfo: {
appCodeName: navigator.appCodeName,
appName: navigator.appName,
appVersion: navigator.appVersion,
cookieEnabled: navigator.cookieEnabled,
language: navigator.language,
platform: navigator.platform,
userAgent: navigator.userAgent
},
datasite: {
"@accountID": "2",
"@siteID": "3"
}
};
$('#send').click(function(){
var data = objJSON;
$.ajax({
url : 'https://www.evstest.com/G3v1LastVersion/portal/portal_action.php',
data : data,
method : 'post', //en este caso
dataType : 'json',
success : function(response){
alert("funciona bien");
},
error: function(error){
alert("No funciona");
}
});
});
}
I have tried to make an alert to see the JSON if it is well built and yes. then the code that supposedly sends it, seems to do nothing, because they do not execute the alert code lines, where it says it has been sent or not.
I hope that this helps you to try to help me. Greetings and thanks again