Hi
I have a website of poetry, what I would like is for users to be able to leave comments on the poems they've read, I already have a system for voting on a poem but I thought it might be nice to be able to leave a small comment.
Would this be possible? and if the answer is yes how would I start?

Thanks

Very simple. List all the comments in the table(if any), have a textarea and a button. When the button is clicked, add the contents of textarea to the comments column.
Eg.

<?php
//connect
//select db

if(isset(submit button)){
 if(!empty(textarea){
  //insert into table (comments) values (textarea_contents)
}
}
//query to display the poem.
//print the poem.
$q="select comments from table where poem_id=$id";
//print the comments
?>
<form>
<textarea name=comments></textarea>
<submit button>
</form>

Thanks for the reply Navman,
I half understand what's happening in the code you've shown me, but I take it I need a database for this to work?

Yep. Or you can write the comments to a file and then display the contents of that file.

Comments
Always willing to help.
This question has already been answered. Start a new discussion instead.