1) {
$posts[] = array('user' => $parts[0],
'time' => date('Y-m-d H:i', $parts[1]),
'message' => $parts[2]);
}
}
}
$error = false;
if (isset($_POST['userpost']) && empty($_POST['email'])) {
$name = filter_var($_POST['userpost'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$name = trim($name);
$name = str_replace(',', ',', $name);
$name = str_replace(',', ',', $name);
$url = filter_var($_POST['urlpost'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$url = trim($url);
$url = str_replace('http://','',$url);
$url = str_replace('https://','',$url);
$url = rtrim($url,"/");
$url = str_replace(',', ',', $url);
$time = time();
$message = filter_var($_POST['messagepost'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
$message = str_replace("\r\n", "
", $message);
$message = str_replace(',', ',', $message);
if (($name != '') AND ($message != '')
) {
if (!empty($url)) {
$user = '' . $name . '';
} else {
$user = $name;
}
$line = $user . ',' . $time . ',' . $message . "\n";
// uncomment the two lines below and add your email address if you want to receive an email when you get a new message
$mailline = "a message by " . $name . " @ " . date('Y-m-d H:i', $time) . "\n" . $url . "\n\n" . $_POST['messagepost'];
mail('guestbooks@alifeee.net', 'guestbook entry', $mailline);
header('Location:./');
$file = fopen($data, 'a');
if (!fwrite($file, $line)) {
$error = '
Welcome to the guestbook for my notes page! I hope you've been enjoying it ^.^
Adapted from baccyflap's PHP guestbook, HTML does nothing. source.
$post) { if ($SHOW_MESSAGES != "" && $SHOW_MESSAGES <= $index) { return; } echo '