Comments ID
Posted: Fri Sep 12, 2008 7:00 am
Code: Select all
<?php
session_start();
$id = $_SESSION['id'];
?>
<?php
$comment=$_POST['comment'];
mysql_query("INSERT INTO comments (from_u_id, comment) VALUES ('$id', '$comment')");
echo "Comment added successfully.";I will try and break down exactly what we're trying to do. It's all a bit new to us!!
People log into the system and use sessions with their user ID
When posting comments we want to use their user id (to and from) so that the correct comment is displayed on their page
We also want their names to show up so they know who it is from