Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem on Win32 only??

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello,

I am using a script that takes a html page from the internet, that adds the absolute URL and that finally
sends the parsed html to a mail recipient.

Each time I run it on win32, it makes Apache restart!
I've tried it on the remote server (Unix) and mails
are distributed as required.

The problem is that I don't know if the script makes Apache restart on the unix server.

Does anyone have any idea? Is there a way I can notice if the server has restarted because a script error?

Anyway, here is the code below:

// FROM URL SECTION
$url = "$domain = "$to_use = fopen($url, "r");

$html = "";

while (!feof($to_use)) {
$html .= fgets($to_use, 2000);
}

$html = str_replace("src=\"", "src=\"" . $domain, $html);
$html = str_replace("SRC=\"", "SRC=\"" . $domain, $html);
$html = str_replace("background=\"", "background=\"" . $domain, $html);
$html = str_replace("href=\"", "href=\"" . $domain, $html);

//echo($html);

// CREATE HEADER SECTION
$headers = "From: me@domain.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("HTMLDEMO");
$headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n";
$headers .= "This is a MIME encoded message.\r\n\r\n";
$headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode("This is the plain text version!"));
$headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=Shift_JIS\r\n" . "Content-Transfer-Encoding:base64\r\n\r\n";
$headers .= chunk_split(base64_encode($html));


// SEND MAIL SECTION
mail("me@domain.com", $url, "", $headers);

My Work...
...and More...
 
Hi.

Suse 8, Apache 1.3.26, Apache is not affected by the script.
Have you tried commenting out line by line to say which line causes the problem you described?

cu, Sascha cu, Sascha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top