I am using curl to fetch result from Punchtab when I execute this code I am getting curl exception 3 No URL set! can any one help me with it.
$tocken2 = "https://api.punchtab.com/v1/user?access_token=".$rest->authResponse->accessToken;
$ch1 = curl_init();
$ca = 'c:/path/to/ca-bundle.crt';
curl_setopt($ch, CURLOPT_URL,$tocken2);
curl_setopt ($ch1, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch1, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch1, CURLOPT_POST, 1);
curl_setopt($ch1, CURLOPT_REFERER, "http://locatefirms.in");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch1);
$errorMsg = curl_error($ch1);
$errorNumber = curl_errno($ch1);
echo $errorMsg;
echo $errorNumber;
echo $server_output;exit;
Your curl handle is
$ch1, but you’re setting the URL option to$ch.Quite obviously, to fix this, you need to change the statement to