0

I have this code, I don't know if it's true or not

<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>

<body>
<form name="ajaxform" id="ajaxform" action="https://www.golantelecom.co.il/rpc/web.account.rpc.php?action=login&p_action=" method="POST">
    username: <input type="text" name="username" value ="1863818"/> <br/>
    password: <input type="text" name="password" value ="000000000000" /> <br/>
</form>

<input type="button"  id="simple-post" value="login" />


<script>
!!!
</script>

</body>
</html>

I want to log in silently, without going to the original login page, and saving cookies in my browser.

It prints a message on the html page under the login button: "Login successfully with 1863818" after pressing the login button.

How does the script know that this login is true or false? I want the script to read the "source page" to search for a specific word (I specify it) If it finds it, the login has been successful, and if it does not, it means that the login failed.

Ahmad Akal
  • 95
  • 7
  • Instead of using a form, you can use AJAX to send the request and check for the response if login is successful or not, based on response codes. – Krishna Nov 13 '19 at 02:52
  • @Krishna I'm here to find someone to write me AJAX code :) – Ahmad Akal Nov 13 '19 at 02:53
  • @AhmadAkal a lot of people already wrote AJAX code for you :) Just search here in StackOverflow or Google it. – Bruno Monteiro Nov 13 '19 at 03:08
  • @BrunoMonteiro I have already searched a lot and have found nothing that matches my request perfectly – Ahmad Akal Nov 13 '19 at 03:11
  • Are you sure you can make a AJAX request to the `url` you have posted above? There is something called `CORS` and if the people at your added url haven't allowed requests from other server to them, you can't make a AJAX request to them. – Deepak Singh Nov 13 '19 at 03:16
  • @DeepakSingh Yes, you can send a post request, through another site, you can try it, send a request to https://www.golantelecom.co.il/rpc/web.account.rpc.php?action=login&p_action= – Ahmad Akal Nov 13 '19 at 03:20
  • @AhmadAkal you will probably not find something that matched your request perfectly, but I am pretty sure you will find how to use AJAX and you can, from there, modify the information for your need. Try to post some code and we can help you from there. – Bruno Monteiro Nov 13 '19 at 03:23
  • @BrunoMonteiro I make simple requests using Javascript + iframe Please visit this page: https://ahmserv.com/test.html – Ahmad Akal Nov 13 '19 at 03:28
  • @BrunoMonteiro The main goal: to get the result without sending the application in iframe – Ahmad Akal Nov 13 '19 at 03:29
  • @AhmadAkal Check this [answer](https://stackoverflow.com/questions/14449118/php-ajax-login) – Ahamed Safnaj Nov 13 '19 at 05:10

0 Answers0