Jump to content

User posted comments


Recommended Posts

Might be better off using Wordpress for user accounts and posting.
That's pretty much what ran through my mind when the person asked if I could do it, though it doesn't seem to be a suitable solution for them. Thanks though :) Edited by Drae
Link to comment
Share on other sites

I couldn't figure out the best place to post this, but if I wanted to create a website that would enable guests to post comments (possibly registered as well), what would I need to know coding-wise?
All i can suggest,is using PHP with HTML Forms.
 <form type='submitcom.html' method='POST'>Name: <br><input type='text' name='name'><br>Email: <br><input type='email' name='email'><br>Comment: <br><textarea name="comment"></textarea><br><input type='submit' name='submit' value='Login'></form>


[color=#880000]<?PHP [/color] $name = $_POST['name'][color=#880000]$email = $_POST['email'][/color][color=#880000]$comment = $_POST['comment'][/color] mysql_query[color=#666600]([/color][color=#008800]"INSERT into {TABLE NAME} VALUES ('{$name}', '{$email}', '{$comment}') [/color][color=#666600]?>[/color]

Then in the place where you want the comments;

[color=#000000]<?PHP [/color] mysql_connect [color=#666600]([/color][color=#880000]host,username,password,dbname);[/color] mysql_query ("SELECT * FROM {TABLE NAME}") ?> 

Then echo the results of the select,and style the echo into some sort of table.

Edited by MarkT
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...