i try using bouth of your solutions but I still have the same problem.. this is the all code for the page maybe I'm doing something wrong
<?php
require_once("includes/session.php");
include('includes/connection.inc.php');
include('includes/corefuncs.php');
$conn = dbConnect('query');
$min = 42;
$max = 118;
$disallowed = array(117);
function mt_rand_n($min="1",$max,$disallowed) {
if (!is_array($disallowed)) return false;
$numbers = array_values(array_diff(range($min,$max),$disallowed));
if (count($numbers) < 1) return false;
return $numbers[mt_rand(0,count($numbers) - 1)];
}
$id_rand = mt_rand_n($min, $max, $disallowed);
$sql = "SELECT feed_id,user_nickname,gender,image_normal,user_age,user_location,user_status FROM feed WHERE feed_id='$id_rand' ";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
?>
<div id="dude">
<form id="rating" name="rating" method="post" >
<input type="radio" name="rating" value="1" onClick="this.form.submit()" />Good
<input type="radio" name="rating" value="2" onClick="this.form.submit()" />Really Good
<input type="radio" name="rating" value="3" onClick="this.form.submit()" />Awesome
</p>
</form>
<p><?php echo $row['user_nickname']; ?> / <?php echo $row['user_age'];?> / <?php echo $row['user_status'];?>/
<?php echo $row['user_location'];?></p>
<img src="<?php echo $row['image_normal']; ?>" />
<p><?php echo $row['user_feed']; ?></p></td>
<td width="83" align="left" valign="top" bgcolor="#FFFFFF">
feed_id : <?php echo $row['feed_id']; ?>
<form id="comment" name="comment" method="post">
<label for="article" class="style2">Que cuentas</label>
feed_id : <?php echo $row['feed_id']; ?>
<p><textarea name="article" cols="35" rows="4" class="style3" id="article"></textarea></p>
<p><input type="submit" name="comment" id="comment" value="comment" />
<input name="message_for" type="hidden" id="message_for" value="<?php echo $row['feed_id'];?>"/>
</p>
</form>
<?php
//**************************************************************************
if (array_key_exists('comment', $_POST)) {
// create database connection
$conn = dbConnect('admin');
// remove backslashes
nukeMagicQuotes();
// prepare an array of expected items
$expected = array('carry_user_id','feed_id','article', 'message_for');
// make $POST data safe for insertion into database
foreach ($POST as $key => $value) {
if (in_array($key, $expected)) {
${$key} = mysql_real_escape_string($value);
}
}
// initialize error array
$comment_message = array();
// check length of usecomment
if (empty($article)) {
$comment_message[] = 'Please enter your comment';
}
//if (!$comment_message) {
if ($row['feed_id'] ) {
echo $row['feed_id'];
// prepare the SQL query
$sql_comment = "INSERT INTO journal (carry_user_id, article, created, message_for)
VALUES('$user_id', '$article', NOW(),'{$row['feed_id']}')";
// process the query
$comment_result = mysql_query($sql_comment) or die(mysql_error());
}
}
//******************************************************************
?>
</td></tr><tr bgcolor="#CCCCCC">
<th align="left" valign="top" bgcolor="#FFFFFF" >
</th>
<td align="left" valign="bottom" bgcolor="#FFFFFF">
</td>
</tr>
</table>
</div>
<br class="clearfloat" />
<?php include('includes/footer.php'); ?>