Curl 7hrs later

software development

#1

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 .= "

$ads
$msg

";

$msg .= select_properties($update_class, $change, $msg);
/Footer for email/

$apiURL = “http://www.investorsclassifieds.com/footer.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);
$msg .= curl_exec($ch);
curl_close($ch);

Any help would be great! Thanxs in advance.


#2

$msg .= “

$ads$msg

in English:

message = message + ads + message

which explains why it is printed twice.

:cool: Perl / MySQL / HTML+CSS


#3

Atropos7 - Great Catch! Thanks a TON!!!