-
-
Save gsmcwhirter/2371 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$qry_str = 'publisher=9284102052512106'; | |
$url = "http://api.indeed.com/ads/apisearch?". $qry_str . '&q=' . $_GET['q'] . '&l=' . $_GET['l']; | |
$ch = curl_init(); // initialize curl handle | |
curl_setopt($ch, CURLOPT_URL, $url); // set url to post to | |
curl_setopt($ch, CURLOPT_FAILONERROR, true); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);// allow redirects | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return into a variable | |
//curl_setopt($ch, CURLOPT_TIMEOUT, 3); // times out after 4s | |
//curl_setopt($ch, CURLOPT_POST, true); // set POST method | |
$result = curl_exec($ch); // run the whole process | |
if(!$result) | |
{ | |
echo curl_error($ch); | |
} | |
curl_close($ch); | |
echo $result; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment