quickstopman Posted May 16, 2007 Share Posted May 16, 2007 i currently have a user profile system and i want to make it so someone can post a comment on there profile but.. it doesn't work here is a list of the rows in the table user_id // is i think what will make it so it only shows the comments sent to that user timdate commentID user comment here is the code: <? ob_start(); session_start(); require 'config.php'; $id = $_GET['id']; $user = $_SESSION['username']; if (isset($_SESSION['username'])) { $sql = mysql_query("SELECT * FROM `profile_comment` WHERE user_id = '{$id}' ORDER BY timedate") OR die(mysql_error()); $comments = mysql_fetch_array($sql); while($list = $comments) { $list['user']; } $username = $_POST[$user]; $comment = $_POST['comment']; $submit = $_POST['submit']; if ($submit) { $post = mysql_query("INSERT INTO `profile_comment` SET (`id` = '$id', `user` = '$username', `comment` = '$comment') WHERE commentID"); echo "Your comment has been Submitted."; } else { ?> <form method='POST' action='profile.php?id=<? echo $id; ?>'> <textarea cols='20' rows='5' name='comment'></textarea><br> <input type='submit' value='Submit Comment' name='submit'> <? } } else { echo 'Please <a href="userlogin.php">Login</a> or <a href="register.php">Register</a><br> to Comment.'; } ?> any help would be nice. Quote Link to comment https://forums.phpfreaks.com/topic/51744-profile-comment-help/ Share on other sites More sharing options...
john010117 Posted May 16, 2007 Share Posted May 16, 2007 What do you mean "it doesn't work"? Error messages? Blank pages? In which part does it not work? Quote Link to comment https://forums.phpfreaks.com/topic/51744-profile-comment-help/#findComment-254879 Share on other sites More sharing options...
quickstopman Posted May 16, 2007 Author Share Posted May 16, 2007 nothing is posted at all sorry for not being so explanitory Quote Link to comment https://forums.phpfreaks.com/topic/51744-profile-comment-help/#findComment-254880 Share on other sites More sharing options...
quickstopman Posted May 17, 2007 Author Share Posted May 17, 2007 any one? Quote Link to comment https://forums.phpfreaks.com/topic/51744-profile-comment-help/#findComment-254947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.