-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bdc8b9
commit 1445f2d
Showing
2 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
<h1>Processing Comment...</h1> | ||
|
||
<?php | ||
|
||
// code modified from https://github.com/mpalmer/jekyll-static-comments | ||
|
||
$DATE_FORMAT = "Y-m-d H:i"; | ||
|
||
$EMAIL_ADDRESS = "[email protected]"; | ||
|
||
$SUBJECT = "Blog comment received"; | ||
|
||
$msg = "date: " . date($DATE_FORMAT) . "\n"; | ||
|
||
foreach ($_GET as $key => $value) { | ||
if (strstr($value, "\n") != "") { | ||
$value = str_replace("\n", "\n ", $value); | ||
} | ||
$value = "'" . str_replace("'", "''", $value) . "'"; | ||
$msg .= "$key: $value\n"; | ||
} | ||
|
||
if (mail($EMAIL_ADDRESS, $SUBJECT, $msg)) | ||
{ | ||
echo '<h1>Comment Received!</h1>'; | ||
echo '<p>Thank you for your comment. It will be reviewed and published shortly.</p>' | ||
$return_url = $_GET['comreturnurl']; | ||
$return_delay = 5; //Number of seconds | ||
echo "<meta http-equiv=\"refresh\" content=\"$return_delay;url='$return_url'\" />"; | ||
echo '<p>You will be redirected to the original post in 5 seconds. Click the link below if you are not redirected automatically.</p>'; | ||
echo '<p><a href="'.$return_url.'">'.$return_url.'</a></p>'; | ||
} | ||
else | ||
{ | ||
echo '<h1>Error!</h1>' | ||
echo '<p>There was a problem sending the comment. Please contact the site's owner.</p>'; | ||
} | ||
|
||
?> |