Comment error messages
-
When a user tries to post a comment on my site, they receive this message:
Could not open the page “http://index.php/?p=8&c=1� because the server “index.php� could not be found.
However, when the user returns to the site, the comment is there! This is leading some users to post again, because there’s no immediate confirmation that the comment was accepted.
Any ideas what’s wrong? I haven’t done any hacking of the code – I’ve barely even edited the templates!
-EAK
(eak@drkissling.com)
Here’s the current comments file, “b2comments.php”:
<?php // Do not delete these lines
if ('b2comments.php' == basename($HTTP_SERVER_VARS['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (($withcomments) or ($c)) {
if (!empty($post->post_password)) { // if there's a password
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
echo("Enter your password to view comments.");
return;
}
}
$comment_author = trim($HTTP_COOKIE_VARS["comment_author"]);
$comment_author_email = trim($HTTP_COOKIE_VARS["comment_author_email"]);
$comment_author_url = trim($HTTP_COOKIE_VARS["comment_author_url"]);
$comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date");
?>
<!-- You can start editing here. -->
<h2>Comments</h2>
/wp-commentsrss2.php?p=<?php echo $id; ?>">RSS feed for comments on this post.
<?php if ('open' == $post->ping_status) { ?>
The URI to TrackBack this entry is: <?php trackback_url() ?>
<?php } ?>
<ol id="comments">
<?php
// this line is WordPress' motor, do not delete it.
if ($comments) {
foreach ($comments as $comment) {
?>
<li id="comment-<?php comment_ID() ?>">
<?php comment_text() ?>
<cite><?php comment_type(); ?> by <?php comment_author_link() ?> <?php comment_date() ?> @ "><?php comment_time() ?></cite><?php } // end for each comment
} else { // this is displayed if there are no comments so far
?>- No comments yet.
<?php } ?>
<h2>Leave a Comment</h2>
<?php if ('open' == $post->comment_status) { ?>
Line and paragraph breaks automatic, website trumps email, HTML allowed:<?php echo htmlentities(str_replace('<', ' <', $comment_allowed_tags)); ?>
<form action="<?php echo $siteurl; ?>/b2comments.post.php" method="post" id="commentform">
<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
<label for="author">Name</label>
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" />
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
<label for="email">Email</label>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
<label for="url">URI</label>
<label for="comment">Your Comment</label><textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
<input name="submit" type="submit" tabindex="5" value="Say it!" />
</form>
<?php } else { // comments are closed ?>
Sorry, comments are closed at this time.
<?php } ?>
<div>Go back.</div>
<?php // if you delete this the sky will fall on your head
}
?>
The topic ‘Comment error messages’ is closed to new replies.