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 = '
I could not post your message, probably a problem with serverside file permissions.
'; } fclose($file); unset($_POST); } else { $error = '
It looks to me like you did not fill in a name or a message.
'; } } ?>

guestbook for alifeee's notes

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 '
', $post['user'], ' (', $post['time'], ')
', stripslashes($post['message']), '
', "\n"; } } else { echo '
I could not post your message, probably a problem with serverside file permissions.
'; } ?>