0) { $encoded_string = ''; for ($i = 0, $j = strlen($_SERVER["HTTP_REFERER"]); $i < $j; $i++) { $encoded_string .= str_pad(ord($_SERVER["HTTP_REFERER"]{$i}), 3, '0', STR_PAD_LEFT); } return $encoded_string; } else { return ''; } } // 1. Check that the server has cURL installed (cURL is required) if (!function_exists('curl_init')){ die('Yoshki: Error encountered - cURL is not installed on this server and is required for Yoshki validation.'); } // 2. Get and encode the query string (puts the '?' at the front if the query string exists) $query_string = ''; if (isset($_SERVER['QUERY_STRING']) AND strlen($_SERVER['QUERY_STRING']) > 0) { $query_string = '?' . $_SERVER['QUERY_STRING']; } $query_string = urlencode($query_string); // 3. Create a handle to cURL resource $ch = curl_init(); // 4. Build the URL for the request $request_url = 'http://yoshki.com/validateservice.aspx?auth=adk33c&query=' . $query_string . "&p=" . EncodeReferrer(); //Uncomment the following line to print the request URL that is generated: //echo $request_url; // 5. Set up and execute the cURL request curl_setopt($ch, CURLOPT_URL, $request_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_REFERER, SITE_URL); $yoshki_validation_html = curl_exec($ch); echo $yoshki_validation_html; ?>