Title: problem with comment form
Last modified: August 19, 2016

---

# problem with comment form

 *  [Sanil Shakya](https://wordpress.org/support/users/sonill/)
 * (@sonill)
 * [16 years ago](https://wordpress.org/support/topic/problem-with-comment-form-1/)
 * hi every body. i m new in wordpress and have been trying to create a theme for
   wordpress. I have watched the video tutorial at nettuts and trying to follow 
   it.
 * now the problem is that,
    i have been trying to add the comment form in the single
   post and it is showing fine.
 * but
 * when i click submit, the page radirects to another url (“[http://localhost/adarsha_samaj/wp-comments-post.php&#8221](http://localhost/adarsha_samaj/wp-comments-post.php&#8221);)
   and it stops there with nothing in the screen.
 * i m confused, when i re-watched the video tutorial it worked fine in that tutorial,
   and i have done same thing as it show, but the comment in tutorial works but 
   not in mine,
 * can anyone tell me what is the problem?
 * i have pasted the code from comments.php below. this is the form part only. i
   have not included the comment part.
 *     ```
       <?php if (comments_open()):?>
           <!-- start comment form -->
           <div class="grid_15" >
               <h2 class="comment_form">Add your Comment</h2>
               <form action="<?php echo get_option('siteurl');?>/wp-comments-post.php" method="post" id="commentform" >
   
               <?php if($user_ID):?>
               <p>Logged in as <?php echo $user_identity;?> </p>
               <?php else:?>
               <p><input type="text" name="author" id="author" value="" /> </p>
               <p><input type="text" name="email" id="email" value="" /> </p>
               <p><input type="text" name="url" id="url" value="" /> </p>
   
               <?php endif;?>
               <textarea name="comment" id="comment" cols="10" rows="2" ></textarea>
               <p><input type="submit" name="submit" id="submit" value="Submit" /> </p>
               <input type="hidden" name="comment_post_ID" value="<?php echo $ID;?>" />
               <?php do_action('comment_form', $post->ID);?>
               </form>
   
           </div>
           <!-- end comment form -->
       <?php endif;?>
       ```
   
 * my wordpress does not require user to sign in to comment in the post.
 * please help me.

Viewing 1 replies (of 1 total)

 *  [bethany138](https://wordpress.org/support/users/bethany138/)
 * (@bethany138)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-comment-form-1/#post-1530389)
 * Don’t know if you figured it out but try this.
 * Replace this line:
 * `<input type="hidden" name="comment_post_ID" value="<?php echo $ID;?>" />`
 * with this:
 * `<input type="hidden" name="comment_post_ID" value="<?php the_ID(); ?>" />`

Viewing 1 replies (of 1 total)

The topic ‘problem with comment form’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [comment not working](https://wordpress.org/support/topic-tag/comment-not-working/)

 * 1 reply
 * 2 participants
 * Last reply from: [bethany138](https://wordpress.org/support/users/bethany138/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-comment-form-1/#post-1530389)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
