nxs_cURLTestCode

The NextScripts: Social Networks Auto-Poster nxs cURLTestCode function.

Description

nxs_cURLTestCode( $url ); 

Parameters (1)

0. $url
The url.

Usage

  1. if ( !function_exists( 'nxs_cURLTestCode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The url. 
  5. $url = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nxs_cURLTestCode($url); 
  9.  

Defined (1)

The function is defined in the following location(s).

/nxs_functions.php  
  1. function nxs_cURLTestCode($url) {  
  2. $out = 'There is a problem with cURL. You need to contact your server admin or hosting provider. Here is the PHP code to reproduce the problem:<br/><pre style="color:#005800"><?php '."\r\n".' $ch = curl_init(); '."\r\n".' curl_setopt($ch, CURLOPT_URL, "'.$url.'"); '."\r\n".' curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36"); '."\r\n".' curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); '."\r\n".' curl_setopt($ch, CURLOPT_TIMEOUT, 10); '."\r\n".' curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); '."\r\n".' $response = curl_exec($ch); '."\r\n".' $errmsg = curl_error($ch); '."\r\n".' $cInfo = curl_getinfo($ch); '."\r\n".' curl_close($ch); '."\r\n".' print_r($errmsg); '."\r\n".' print_r($cInfo); '."\r\n".' print_r($response); '."\r\n".'?></pre>'; return $out;