0) { // Check if hidden boxes have been filled, if so ban IP if((!empty($_POST['name'])) || (!empty($_POST['location'])) || (!empty($_POST['message']))) { echo("

I think you're a spambot!

You are hereby banned forthwith from making comments.


If you are actually a human and want to leave a comment on the guestbook, please send the site admin an email explaining who you are and that you have been incorrectly banned and the ban should be lifted within 48 hours.

"); banIP(); appendLog('IP banned for filling in hidden input boxes'); exit(); } // Strip slashes if magic quotes if(get_magic_quotes_gpc()) $_POST = array_map('stripslashes', $_POST); // Extract data from post $cmntName = $_POST['fc9z']; $cmntLoc = $_POST['u92s']; $cmntMsg = $_POST['h3wa']; // Check for errors if($cmntName == '') $errCode = $errCode | COMMENT_ERR_MISSING_NAME; if($cmntMsg == '') $errCode = $errCode | COMMENT_ERR_MISSING_TEXT; if(hasURL($cmntMsg)) { $errCode = $errCode | COMMENT_ERR_URL_PRESENT; appendLog('Tried to enter URL' . "\r\nMessage:\r\n\"" . $cmntMsg . "\"\r\n"); } if($errCode == COMMENT_ERR_NONE) { //Submit to database $addName = addslashes($cmntName); $addLoc = addslashes($cmntLoc); $addMsg = addslashes($cmntMsg); $addIP = $_SERVER['REMOTE_ADDR']; $addTime = time() + 3600; // Connect to database $sqlSuccess = COMMENT_SUBMIT_SUCCESS; $sqlConnect = @mysql_connect('localhost', DB_PHOTO_UN, DB_PHOTO_PW); if(!sqlConnect) $sqlSuccess = COMMENT_SUBMIT_FAIL; $sqlPhotos = @mysql_select_db(DB_PHOTO_DB); if(!sqlPhotos) $sqlSuccess = COMMENT_SUBMIT_FAIL; // Check for existing mirror comments (has page been refreshed?) $sqlQuery = 'SELECT * FROM ' . DB_TABLE_COMMENTS . ' WHERE ' . "photo=$id AND " . "name='$addName' AND " . "location='$addLoc' AND " . "message='$addMsg'"; $sqlCheck = mysql_query($sqlQuery); if(mysql_num_rows($sqlCheck) > 0) $sqlSuccess = COMMENT_SUBMIT_NONE; else { $sqlQuery = 'INSERT INTO ' . DB_TABLE_COMMENTS . ' SET ' . "photo=$id, " . "ip='$addIP', " . "timestamp=$addTime, " . "name='$addName', " . "location='$addLoc', " . "message='$addMsg'"; $sqlResult = mysql_query($sqlQuery); if(!sqlConnect) $sqlSuccess = COMMENT_SUBMIT_FAIL; } mysql_close($sqlConnect); // Clear variables so form is blank $cmntName = ''; $cmntLoc = ''; $cmntMsg = ''; } } else { // Increment viewcount if not special IP $ip = $_SERVER['REMOTE_ADDR']; if(($ip != '219.50.246.42') && ($ip != '61.206.247.68') && ($ip != '61.206.247.70') && ($ip != '75.187.153.167')) { $pDat['views'] = $pDat['views'] + 1; $sqlConnect = @mysql_connect('localhost', DB_PHOTO_UN, DB_PHOTO_PW); $sqlPhotos = @mysql_select_db(DB_PHOTO_DB); $sqlQuery = 'UPDATE ' . DB_TABLE_PHOTO . ' SET views=' . (string)($pDat['views']) . ' WHERE id=' . $id . ' LIMIT 1'; $sqlResult = mysql_query($sqlQuery); // Add view to view-tracker $viewQuery = 'INSERT INTO views SET ' . "ip='$ip', " . 'timestamp=' . (time() + 3600) . ', ' . "photo=$id"; $viewResult = mysql_query($viewQuery); mysql_close($sqlConnect); } } echo("\n"); ?> Leizel & Jeff - Photos - <?php echo(htmlspecialchars($pDat['title'])); ?>

There was a problem with your comment input
Please see the warnings at the bottom' . "\n"); if($sqlSuccess == COMMENT_SUBMIT_SUCCESS) echo('

Your comment was successfully submitted

' . "\n"); if($sqlSuccess == COMMENT_SUBMIT_FAIL) echo('

There was an error submitting your comment
Please try again in a few minutes
If problem persists, please contact the groom

' . "\n"); // Calculate previous and following indexes $idBack = (int)($id - 1); if($idBack == PHOTO_ID_MIN - 1) $idBack = PHOTO_ID_MAX; $idNext = (int)($id + 1); if($idNext == PHOTO_ID_MAX + 1) $idNext = PHOTO_ID_MIN; ?>
<?php echo(htmlspecialchars($pDat['title'])); ?>
view
Photo by of Imagen Photography



Comments temporarily unavailable
Please check back in a few minutes' . "\n"); } else { // Check number of comments if(mysql_num_rows($sqlResults) < 1) { echo('

No comments yet...

' . "\n"); } else { // Loop through comments and output into HTML display while($sqlRow = mysql_fetch_array($sqlResults)) { ?>
AuthorComment




'); } } mysql_close($sqlConnect); if(isBannedIP() == false) { ?>

Add a comment

Please enter your name
Name: Location:

Please refrain from entering website URL addresses
CommentsPlease enter your message here'); ?>