php question
by SUrOB <leviking(at)worldonline.fr>
|
Date: |
Tue, 09 May 2000 16:04:15 +0200 |
To: |
hwg-techniques(at)hwg.org |
|
todo: View
Thread,
Original
|
|
Hi,
I made a guestbook for a site i'm actually working on it. It runs good, but
I would like to add a function for mailing me news messages leave by the
visitor. I have tried several times, but I don't find the good syntax or
I make a mistake.
Here's source of my guestbook, if anyone
<!--
Here the part which takes variables from the form and write them to a file
on the server
<?php
if (file_exists("guestbook"))
$new=FALSE;
else
$new=TRUE;
if ($new)
{
$tf = fopen("guestbook", "w");
$nb_entries=1;
}
else
{
$gb = fopen("guestbook", "r");
$tf = fopen("guestbook.$$$", "w");
$nb_entries = fgets($gb, 16) + 1;
}
fputs($tf, ($nb_entries."\n"));
fputs($tf, (gmdate("d/m/Y - H:i ").strip_tags($text)."\n"));
fputs($tf, (strip_tags(trim($name)."\n")));
fputs($tf, (strip_tags(trim($email)."\n")));
fputs($tf, (strip_tags(trim($url)."\n")));
fputs($tf, (strip_tags(trim($comments)."\n")));
fputs($tf, "#!#!#!#\n");
if ($new)
{
fclose($tf);
}
else
{
while (!feof($gb))
{
$temp = fgets($gb, 8192);
fputs($tf, $temp);
}
fclose($gb);
fclose($tf);
unlink("guestbook");
rename("guestbook.$$$", "guestbook");
}
echo "<P><FONT face=\"Verdana\" size=\"-1\"><B>Merci $name d'avoir
signé notre livre d'or !</B></FONT></P>";
?>
-->
I try this but get a count() error when executing it on the server
mail ("nyczone.free.fr","Message livre d'or AD",
$text,$name,$email,$url,$comments, "From:webmaster(at)nyczone.net");
Any help accepted and appreciated !
SUrOB
Fondateur et webmaster principal de NYCZone - http://www.nyczone.net
Membre de l'International Webmasters Association - http://www.iwanet.org
Membre de The HTML Writers Guild - http://www.hwg.org
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA