Random commenters receiving: Error: please enter a valid email address.
-
I stylized my comments.php file (using the default theme as a base) for the first time so perhaps I’ve mussed something up. It appears that many can comment just fine, but others when they submit their perfectly valid email address etc, they get an error page that reads:
Error: please enter a valid email address.
You can try it out yourself with my e-mail: jessica (at) kerflop (dot) com at: https://kerflop.com/2008/01/21/new-layout-work-in-progress/#comments (my theme is still under construction)
I’m guessing it might be accepting comments from those who are logged in – but not from those who aren’t. But I’m not sure how to rectify this in the code below without breaking the layout.
And here is the code. Any thoughts?
Thank you in advance.
<?php // Do not delete these lines if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); if (!empty($post->post_password)) { // if there's a password if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie ?> <p class="nocomments">This post is password protected. Enter the password to view comments. <?php return; } } /* This variable is for alternating comment background */ $oddcomment = 'class="alt" '; ?> <!-- You can start editing here. --> <?php if ($comments) : ?> <div class="comments"> <ul> <li><?php comments_number(__(''), __('1 Comment'), __('% Comments')); ?> <?php if ( comments_open() ) : ?> <a href="#postcomment" title="<?php _e("Leave a comment"); ?>"><img src="https://kerflop.com/wp-content/themes/chocolate_kerflop/images/ico-arrow.gif" alt="leave a comment" /></a> <?php endif; ?> <ul> <?php foreach ($comments as $comment) : ?> <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"> <div class="comm-top"></div> <?php if ($comment->comment_approved == '0') : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <?php comment_text() ?> <div class="time"><em><cite><?php comment_author_link() ?></cite> on <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('m-d-y') ?> at <?php the_time('g:i a'); ?></a></em></div> <?php /* Changes every other comment to a different class */ $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; ?> <?php endforeach; /* end for each comment */ ?> </li> </ul> </li> </ul> </div> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="spacer">Comments are closed. <?php endif; ?> <?php endif; ?> <?php if ('open' == $post->comment_status) : ?> <!--/comment--> <div class="box4"> <div class="box4-top"> <h3>Leave a Comment</h3> </div> <div class="spcr"> <?php if ( get_option('comment_registration') && !$user_ID ) : ?> You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment. <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if ( $user_ID ) : ?> Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a> <?php else : ?> <fieldset id="commenting"> <div> <label for="author">Name <?php if ($req) echo "<em>*</em>"; ?></label> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> </div> <div> <label for="author">E-Mail address: <?php if ($req) echo "<em>*</em>"; ?> <small>(never shown or shared)</small></label> <input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> </div> <div> <label for="author">Website URL: </label> <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> </div> <?php endif; ?> <div> <label>Your comment: <?php if ($req) echo "<em>*</em>"; ?></label> <textarea name="comment" id="comment" cols="" rows="" tabindex="4"></textarea> </div> <div> <input name="" type="image" src="https://kerflop.com/wp-content/themes/chocolate_kerflop/images/btn-submit.gif" value="Submit" class="btn" style="border: 0px;" /> <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> </div> </fieldset> <?php do_action('comment_form', $post->ID); ?> </form> <div id="ftime"> <h3>First Time Commenting?</h3> <a href="https://kerflop.com/comment-policy/">Read the comment policy</a> <em>*</em> indicates a required field </div> <!--/ftime--> <div class="fix"></div> </div> <!--/spacer --> <div class="box4-bot"></div> </div> <?php endif; // If registration required and not logged in ?> <?php endif; // if you delete this the sky will fall on your head ?>
- The topic ‘Random commenters receiving: Error: please enter a valid email address.’ is closed to new replies.