hi, I cannot show the new messages in the first place in this book of visits .help please. thanks
http://usuarios.lycos.es/cameron23/
[COLOR=DarkGreen]DOWNLOAD THE SOURCE [COLOR=Red]HERE[/COLOR][/COLOR]
<?
//No need to edit anything below here.
if (!isset($name) || !isset($email) || !isset($message) || empty($name) || empty($email) || empty($message)) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Input required for all fields.");
exit;
}
$email = strtolower($email);
addentry($name, $email, $website, $message);
function addentry($name, $email, $website, $message) {
$posted = strftime("%D %I:%M %p");
$message = stripslashes($message);
$file = fopen('entry.txt', 'a+');
if (!$file) {
print "&result=Fail";
print "&errorMsg=" . urlencode("Could not open entry.txt file. Change CHMOD levels to 766.");
exit;
}
fputs($file, "<font color=\"#11396D\">Name:</font> $name
<font color=\"#11396D\">Email:</font><font color=\"#666666\"><A href=\"mailto:$email\"> $email</A></font><br>
<font color=\"#11396D\">Website:</font><font color=\"#666666\"><A href=\"http://$website\"target=\"_blank\"> $website</A></font><br>
<font color=\"#11396D\">Posted:</font> $posted
<font color=\"#11396D\">Message:</font> $message
");
fclose($file);
// Send admin an email when new entry occurs
mailAdmin($name, $email, $website, $message);
}
function mailAdmin($name, $email, $website, $message) {
$mailTo = "[email protected]";
$mailFrom = "From: <[email protected]>";
$mailSubject = "New Guestbook Entry";
$mailBody = "A visitor to your site has left the following information in your guestbook:
Name: $name
Email: $email
Website: $website
The visitor commented:
------------------------------
$message
------------------------------
You can view the message at:
http://www.yoursite.com";
mail($mailTo, $mailSubject, $mailBody, $mailFrom);
mail($email, "Your Subject", "Thank you message", "From: [email protected]");
}
print "&result=okay";
exit;
?>