Curl 7hrs later
Posted by: zenman
Posted on: 2006-06-07 06:06:00
2 wks of reprogramming after switching to dreamhost. Im finally stuck. Im trying to send my HTML news letter to tell people we are back online. Anyway Im done venting! Here is the proplem. I need to replace the function of fopen() and discovered that Curl is my best option. For what ever reason it keeps printing to the screen? and if I change curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0) zero to one it prints twice. Here is the script:
/*Header for email*/
$apiURL = "http://www.investorsclassifieds.com/header_email.php";
$ch = curl_init();
$timeout = 0; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL,$apiURL);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_exec($ch);
curl_close($ch);
$ads = stripslashes($ads);
$msg .= "<p>$ads
$msg</p>