
February 1st, 2013, 01:28 PM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 2
Time spent in forums: 1 h 17 m 45 sec
Reputation Power: 0
|
|
|
New Member - Comment FORM - comments.php
Hi, I need the comments for my blog to work. They will be on the same page and automatically post. I searched the forum and tried a tutorial (can't post url link) , but still no bueno!
here is the current html of the form:
<div id="respond">
<div class="cancel-comment-reply"><a rel="nofollow" id="cancel-comment-reply-link" href="#respond" style="display:none;">Cancel reply</a></div>
<form action="comments.php" method="post" id="commentform">
<h3 class="heading">LEAVE A REPLY</h3>
<input type="text" name="comments" id="author" value="" tabindex="1" />
<label for="author">Name <small>*</small></label><br/>
<input type="text" name="email" id="email" value="" tabindex="2" />
<label for="email">Email <small>*</small> <span>(not published)</span></label><br/>
<input type="text" name="url" id="url" value="" tabindex="3" />
<label for="url">Website</label>
<textarea name="comment" id="comment" tabindex="4"></textarea>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Post" /></p>
<input type='hidden' name='comment_post_ID' value='' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='0' />
</form>
</div>
<div class="clearfix"></div>
and here is the php i added as per the guys' instructions:
<?php
$hFile = fopen( "comments.txt", "a+" );
fwrite( $hFile, "$comments" );
fclose( $hFile );
?>
I need the comments to post automatically on the page once the user presses send. Extreme novice! Sorry.
I appreciate anyone's help on this. Thanks for your time.
|