so the quick synopsis of what I'm trying to do, is use PHP to pull player data from the website of one of the games I play (Combat Arms) and display that data in a custom forum signature.
So far, I've gotten all the things I want to do with it to work, (displaying rank, kill count, what have you, pulling and resizing a dynamic character avatar...)
Pulling data off the profile pages seems easy enough, but in order to get weapon usage, the page uses a dropdown box to generate a POST form, and I just for the life of me can't get my CURL script to change it.
(see profile page here)
Here's the curl section of my code, when run it gives me my player profile page, complete and good, aside from always displaying the same data, regardless of what I set the __EVENTARGUMENT to.
$yourIGN = "Shoggotha"; // My Combat Arms in-game name
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://combatarms.nexon.net/ClansRankings/PlayerProfile.aspx?user=$yourIGN");
curl_setopt($ch, CURLOPT_POSTFIELDS, array('__EVENTTARGET' => 'ctl00$MainContent$ddlWeaponStats', '__EVENTARGUMENT' => '1'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7");
$gcontent = curl_exec($ch);
print $gcontent
I've been searching for days to figure out some reason why the post data for the dropdown box isn't being changed, but I've seemed to hit a brick wall here.
Now I can manually access the page fine, and select any subcategory of weapons I want, assault rifles, SMG's, and get a list of my usage for any gun I like... But using CURL, currently I can only access guns that show up under the default page setting (favorite; top 10 weapons fired)
If anyone could point me in the right direction as far as how to do this, what I'm doing wrong, things I'm missing, I'd be rather appreciative. I feel like I've hit a brick wall as far as searching for answers goes.