I don't have much experience with JavaScript, but I believe this can be achieved.
I require the script to perform 3 tasks:
Make a GET request to
https://example.com/test.php
which will return this JSON:[{"user_id":"12345","email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2f5b4a5c5b6f5b4a5c5b014c4042">[email protected]</a>","status":"active"}]
Send a POST request to
https://example.com/checker.php
with parameters
- the last two parameters are obtained from the first step. The responses to this request will vary.action=testing&<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="72171f131b1e4f0617010632061701065c111d1f">[email protected]</a>&status=active
Send another POST request to
https://example.com/verified.php
with the parameter
.response=RESPONSE-FROM-STEP-2-HERE
I need these 3 steps to repeat in an infinite loop as long as the visitor remains on the page (starting automatically upon page load).
It seems like in JavaScript, I can use xhttp.open
for both GET and POST requests. The part I'm unsure about is how to utilize those responses in steps 2 and 3.