<?
//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\n<font color=\"#11396D\">Email:</font><font color=\"#666666\"><A href=\"mailto:$email\"> $email</A></font><br>\n<font color=\"#11396D\">Website:</font><font color=\"#666666\"><A href=\"
http://$website\"target=\"_blank\"> $website</A></font><br>\n<font color=\"#11396D\">Posted:</font> $posted\n<font color=\"#11396D\">Message:</font> $message\n\n");
fclose($file);
// Send admin an email when new entry occurs
mailAdmin($name, $email, $website, $message);
}
function mailAdmin($name, $email, $website, $message) {
$mailTo = "webmusta@hotmail.com";
$mailFrom = "From: <webmusta@hotmail.com>";
$mailSubject = "New Guestbook Entry";
$mailBody = "A visitor to your site has left the following information in your guestbook:\n
Name: name
Email: email
Website:
The visitor commented:
------------------------------
$message
------------------------------
You can view the message at:
http://";
mail($mailTo, $mailSubject, $mailBody, $mailFrom);
mail($email, "Your Subject", "Thank you message", "From: email");
}
print "&result=okay";
exit;
?>
i readme filen står der det her hvad skal jeg med det :)
function mailAdmin($name, $email, $website, $message) {
$mailTo = "you@yoursite.com";
$mailFrom = "From: <you@yoursite.com>";
$mailSubject = "New Guestbook Entry";
$mailBody = "A visitor to your site has left the following information in your guestbook:\n
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: you@youremail.com");
}