Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- THIS HAS BEEN SOLVED!! THANK YOU!
- ATTENTION: THIS IS HOW THE CODE IS SUPPORT TO WORK -> http://pastebin.com/gbc4fCDx
- This code returns an error from the server like '0|error|500||'
- <?PHP
- echo (WCCCA_callInfo());
- function WCCCA_callInfo()
- {
- $header = "Cache-Control: no-cache\r\n" .
- "Origin: http://www.wccca.com\r\n" .
- "X-MicrosoftAjax: Delta=true\r\n" .
- "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36\r\n" .
- "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n" .
- "Accept: */*\r\n" .
- "Referer: http://www.wccca.com/PITSv2/\r\n" .
- "X-McProxyFilter: *****************\r\n" .
- "Accept-Language: en-US,en;q=0.8\r\n" .
- "Cookie: __utma=247398914.650647853.1373700322.1382880873.1382940433.232; __utmb=247398914.500.9.1382948378163; __utmc=247398914; __utmz=247398914.1375889172.59.2.utmcsr=tvfr.com|utmccn=(referral)|utmcmd=referral|utmcct=/\r\n";
- $VIEWSTATE = WCCCA_HIDDEN_CODE("VIEWSTATE");
- $EVENTVALIDATION = WCCCA_HIDDEN_CODE("EVENTVALIDATION");
- $postData = "smMain=smMain%7CtmrIncidents&__EVENTTARGET=tmrIncidents&__EVENTARGUMENT=&__VIEWSTATE=" . $VIEWSTATE . "&__EVENTVALIDATION=" . $EVENTVALIDATION . "&__ASYNCPOST=true&";
- $Calls = post("http://www.wccca.com/PITSv2/Default.aspx", $postData, $header);
- return $Calls;
- }
- function WCCCA_HIDDEN_CODE($input) // Get hidden code
- {
- $data = file_get_contents("http://www.wccca.com/PITSv2/Default.aspx");
- $pattern = "/id=\"__" . $input . "\" value=\"([^\"]+)\"/";
- preg_match_all($pattern, $data, $xmlext);
- // Removes all slashes.
- $code = str_replace("/", "", $xmlext[1][0]);
- return $code;
- }
- function post($url, $data, $optional_headers = null)
- {
- $params = array(
- 'http' => array(
- 'method' => 'POST',
- 'content' => trim(preg_replace('/\s\s+/', ' ', $data))
- )
- );
- if ($optional_headers !== null) {
- $params['http']['header'] = $optional_headers;
- }
- $ctx = stream_context_create($params);
- $fp = @fopen($url, 'rb', false, $ctx);
- if (!$fp) {
- throw new Exception("Problem with $url, $php_errormsg");
- }
- $response = @stream_get_contents($fp);
- if ($response === false) {
- throw new Exception("Problem reading data from $url, $php_errormsg");
- }
- return $response;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement