cURL with WordPress
-
Hi
I need to use payment script in wordpress . it is using from cURL.
when I copy code in template page in wordpress , page is locked and curl_exec() doesn’t work . how to fix it ?my code :
$ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, '"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'); curl_setopt($ch, CURLOPT_URL,$API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); if(USE_PROXY) curl_setopt ($ch, CURLOPT_PROXY, PROXY_HOST.":".PROXY_PORT); if(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) { $nvpStr = "&VERSION=" . urlencode($version) . $nvpStr; } $nvpreq="METHOD=".urlencode($methodName).$nvpStr; curl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq); $response = curl_exec($ch);
I tested it . Page is locked in below line :
$response = curl_exec($ch);
- The topic ‘cURL with WordPress’ is closed to new replies.