I made a custom script to assist me in a game I play, but I ran into a curious error that I honestly cant find a solution to.
To help in the game I collected variables from different areas across it, I’m new to php and started learning it 2 weeks ago, I’ve created a database that holds Account Name/Account ID#/Power that loads to a list, created a script to login to the game, then curl back through a loop using a cookie.txt file with a session id that grabs captchas from recaptcha on the accounts and posts them in iframes, for users to submit.
That section all works fine, but the site I’m connecting to uses the _POST http header to input the data when your on a browser, so i attempted to use _POST to input it back into the game (the completed captcha) to join the accounts, when I did this I received error
The requested resource
/joinraid.php
does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.
I went back and double checked the http headers and that the information I’m inputting match’s the information the browser relays exactly. I tryed activating SSL’s and increasing the POST data length on my server, aswell as editing the keep alive timeout and trying every other fix I could find on google. I checked the encoding and char set, to make sure it matched the header as well, so I’m wondering if the problem is in my code.
[php]
<?php include("connect.php"); $cookie = 'temp/cookierb.txt'; //send join raid curl if (isset($_POST['submit'])) { $ch = curl_init(); for ($i = 0; $i < 5; $i++) { //ADD CHECK IF VARIABLE ACTUALLY SET? DECREASES TIME ON CURL POSTS... //echo 'length'.$i.', '.$_POST['suid'.$i.''].': '.strlen($_POST['suid'.$i.'']) .''; if (strlen($_POST['suid'.$i.''])>0) { unlink($_POST["path".$i]); $opt1 = 'http://'.$server.'.outwar.com/joinraid.php?raidid='.$_POST['raidid'].'&suid='.$_POST['suid'.$i.''].'&serverid='.$serverid; $opt2 = 'recaptcha_challenge_field='.$_POST['recaptcha_challenge_field'.$i.''].'&recaptcha_response_field='.$_POST['recaptcha_response_field'.$i.''].'&codeid='.$_POST['codeid'.$i.''].'&submit=Launch!'; //echo 'opt1: '.$opt1.', opt2: '.$opt2.'
'; curl_setopt ($ch, CURLOPT_URL, $opt1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $opt2); curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt ($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ch, CURLOPT_HEADER, 0); $resultt = curl_exec($ch); } } curl_close ($ch); [/php]