'' ); $error = array( 'guestbook' =>'' ); if(!empty($_POST)) { $values = $_POST; $values = strip_magic_quotes($values); if( trim($values['guestbook']) == '' && strlen($values['guestbook']) < 2500 ){ $error['guestbook'] = '*'; $is_error = true; } if(!$is_error && $is_login) { if($_user['User_isadmin']==1){ $status_sql = ", 'aproved'"; } else { $status_sql = ", 'new'"; } $sql = "INSERT INTO `Guestbook` (`Guestbook_id`, `User_id`, `Guestbook_text`, `Guestbook_add`, `Guestbook_status`, `Guestbook_active`) VALUES "; $sql .= "('' , ". (int)$_user['User_id'] ." , '". mysql_real_escape_string($values['guestbook']) ."' , '". date('Y-m-d H:i:s') ."' ". $status_sql ." , '1' )"; if($query = mysql_query($sql)) { if($_user['User_isadmin']==0){ // Send notification $to = _TO_EMAIL_; $subject = "Guestbook message added on toddkerns.com site"; $text = "User Name: ". $_user['User_name'] ."\n\r"; $text .= "User Email: ". $_user['User_email'] ."\n\r"; $text .= "Time: ". date('F j, Y H:s') ."\n\r"; $text .= "------------------------------// comment //------------------------------\n\r"; $text .= $values['guestbook']; $headers = 'From: '. _FROM_EMAIL_ . "\r\n" . 'Reply-To: '. $_user['User_email'] . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $text, $headers); // End send of notification setcookie("notes",'
!!! Your message added and will be displayed after our administrator approved it.
', 0); } else { setcookie("notes",'Your message added at once. You are admin :)
', 0); } header('Location: guestbook.html#mess'); } else { die(mysql_errno() . ": " . mysql_error()); } } } ?>Want to stop by and say hi? Leave a positive comment or message for all those in the TK Army to see!
=$_COOKIE['notes']?>|
=htmlentities($msg['User_name'])?>
=nl2br(htmlentities($msg['Guestbook_text']))?>
=date('F j, Y', strtotime($msg['Guestbook_add']))?>
|
| =renderPageNavigator ($messgs_count, $_page, $page_param, 'guestbook.html', $_page_limit, 10) ?> |
!!! Please correct errors and re-submit form.
You need login to leave comment or message.