[HELP] PHP comment script for websites ?

02/10/2011 07:51 ShinMiyazaki#1
Anyone can share a comment script for website like what youtube has ?
02/11/2011 08:47 gabrola#2
PHP Code:
<?php
if($_POST)
{
    
$con mysql_connect("localhost""DB_USER""DB_PASS") or die("Cannot Connect"); 
    
mysql_select_db("DB_NAME"$con);
    
$Comment $_POST['comment'];
    
mysql_query(sprintf("INSERT INTO comments (comment) VALUES ('%s');"mysql_real_escape_string($Comment)));
    echo 
"Comment posted!";
}
else
{
?>

<form method="post" action="">
    <textarea rows="4" cols="100" name="comment"></textarea>
    <br/>
    <input type="submit" value="Submit Comment" />
</form>

<?php
}
?>
Something I just wrote real quick now.
02/11/2011 11:25 ShinMiyazaki#3
Thank you Gab =]