You are here: PHP srnd two emails « PHP Programming Language « IT news, forums, messages
PHP srnd two emails

Posted by Pablo on 06/27/07 20:50

Hi at all

I call this function when I fill the foot of the body of the email that I'll
send immediately after:

$text.=serial_number();

function serial_number()

{

$file="serial.txt";

for ($try = 0; $try < 5; $try++)

{

$fp = fopen($file, "a+");

if (flock($fp, LOCK_EX)) { // do an exclusive lock

fseek($fp, 0);

$id = fread($fp, 1024);

$id++;

ftruncate($fp, 0);

fwrite($fp, strval($id));

flock($fp, LOCK_UN); // release the lock

break;

}

else

{

sleep(1);

continue;

}

}

fclose($fp);

return $id;

}

The email is sended better and into the last line of the body there is the
new serial number

BUT......... IMMEDIATELY AFTER is sended a second EMPTY email without body
that contain only the serial number (new)

Please where wrong I?

Thank you very much in adbance

Pablo

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация