- Joined
- Mar 29, 2013
- Messages
- 3
- Reaction score
- 0
Hii i am trying to send a POST data request to a game server that isnt mine so i made this code
Now i am only stuck at line 23
which is $cookies_string
I have to define my game login cookies so that the script can recognize its me whos logged in, nobody else
Now when i load the script in my webhost just like its posted above leaving the string blank just like this
the Page just prints
this to me..and when i add my cookies like this:
I get this error:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
kindly, could somebody fix/correct this code and maybe post it back?
Thanks.
PHP:
<?php
$ch = curl_init();curl_setopt($ch, CURLOPT_HEADER, true);curl_setopt($ch, CURLOPT_NOBODY, true);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, "http://www.zwinky.com/zwinky-world/Checkout.jhtml");curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_TIMEOUT, 5);curl_setopt($ch, CURLOPT_USERAGENT, "MozillaXYZ/1.0");
$data = array('creator' => '1','storeId' => '923','items' => '{id:20099080,species:babe,at:keepsake}','pType' => '0');
$cookies_string = "user_num";
$fields_string = "";
foreach($data as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
curl_setopt($ch, CURLOPT_COOKIE, $cookies_string);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
$output = curl_exec($ch);curl_close($ch);die($output);$xml = simplexml_load_string($output);print_r($xml,1);
?>
Now i am only stuck at line 23
which is $cookies_string
I have to define my game login cookies so that the script can recognize its me whos logged in, nobody else
Now when i load the script in my webhost just like its posted above leaving the string blank just like this
$cookies_string = "user_num";
the Page just prints
HTTP/1.1 200 OK Date: Fri, 29 Mar 2013 13:35:39 GMT Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8c DAV/2 mod_jk/1.2.28 Cache-Control: max-age=0, must-revalidate Expires: Thu, 01 Jan 1970 00:00:00 GMT Set-Cookie: anx="os=-&g=-&oc=-&sn=dfprdzwinky13&od=none&op=-&fv=1364564139091&ob=-&om=-&lv=1364564139091&ok=-&nv=1"; Version=1; Domain=.zwinky.com; Max-Age=315000000; Expires=Thu, 23-Mar-2023 09:35:39 GMT; Path=/ Content-Language: en-US Content-Length: 74 Connection: close Content-Type: application/xml;charset=UTF-8
this to me..and when i add my cookies like this:
Code:
$cookies_string = "dcDirtyCookie=s0h4x-%3D1; chromeToolbarInstalled=true; buckets=%7B%22zwinky%22%3A%7B%22scc_count%22%3A%22a%22%7D%7D; sessionData=gvUfMSYC909o+7f4gDl0YgB9A2iFyEC8pfrXplaR2nK/K2SwbTNjbopQpYqmCtiRt9o0iBj8JgbtMj1IAi3S3DQVLkRgJst02yMP+LFpsXGwEi2TCfaiOKsgWWFYHVfixuQWljAedxSdh+SiFsGi4Itaz0KtUCriF+SndoQGNP4ZtvQs7O1ztS9tljQP93Qn; partner=ZJxdm128; mindsparktb_207521081=true; mindsparktbsupport_207521081=true; user_num=GU7bBadOejopYVbNcqNk%2BQ%3D%3D; user_nme=9BCjIbLVRhkxBMMSdN5sKw%3D%3D; gender=rbb7%2BhYSyhflaoAEJ%2FPjqQ%3D%3D; has_creator_assets=1; user_info="5ApFWO5lenBkadDRGAxn3k6o/0EH73rVwMA52F+rc2N2XeOFBL6mmdrKi+V1pph9wYzhllYsAuiiIHr0xKrcAZt35fw0Xb8FQYobSLNRHKI="; qinfo="ugmP9JOPsGgwXkd+Sr2ILg=="; anx="u=DEE3E0D0-558F-4A0E-825D-D8AF878B83F9&fv=1364524504028&lv=1364564271258&nv=546&t=-&v=-&p=-&si=-&sn=dfprdzwinky1&od=zwinky.com&op=index.jsp&ok=-&om=referral&ob=-&oc=-&os=-&w=1920&h=1080&cd=32&f=11.6%20r602&g=%7B%22splitTest%22%3A%7B%22scc_count%22%3A%22a%22%7D%7D&xrp=%5EZJ%5Eyyyyyy%5EYY%5Eil&xh=1186&xi=CRXEXE&xtp=vhigh&xp=vicinio&xrt=YY&xrco=ZJ&xrca=yyyyyy&xrcc=il&xcid=284ae4353bfc46fda0b9a18c2c0a5f22&xuer=3"; anxs="s=832288996&sv=1364563870918&sd=none&sp=-&sk=-&sm=-&sb=-&sc=-&ss=-";
I get this error:
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
kindly, could somebody fix/correct this code and maybe post it back?
Thanks.

