Hi,
I am trying to do a “Leave a feedback to the seller”, like on ebay.
It’s a page that displays all the items for which user has to leave a feedback.
And for each of those displayed items, there is a little Radio button (negative, neutral, positive) and a text input for comment.
The problem I’m having is that if ($_POST[‘submit’]) is SET, my “test string” is applied to all items that need to have a feedback. Obviously, I would like to display a message “You have successfully left a feedback” that will replace the radio buttons and text field for this SPECIFIC item.
I am showing you my code below.
Does anyone have a suggestion? Thanks a lot for your help
[code=php]
<?php
$query=mysql_query(“SELECT * FROM items WHERE buyer=’$username’ AND feedbackleft=’0′”);
echo “You have “.mysql_num_rows($query).” feedbacks to leave:<p>”;
while ($row=mysql_fetch_assoc($query))
{
if (isset($_POST[‘submit’]) && !empty($_POST[‘feedback’]) && !empty($_POST[‘comment’]))
{
echo ‘Test string’;
}
echo ‘<a href=”index.php?item=’.$row[‘item’].'”><b>’.$row[‘title’].'</b></a><br />’;
echo “Seller: “.$row[‘seller’].”<br />”;
?>
<form name=’feedbackform’ method=’POST’>
<input type=”radio” name=”feedback” value=”negative” /> Negative
<input type=”radio” name=”feedback” value=”neutral” /> Neutral
<input type=”radio” name=”feedback” value=”positive” /> Positive
<br />
Comment: <input type=’text’ name=’comment’>
<input type=’submit’ name=’submit’ value=’Submit feedback’>
</form><p>
<?php
}
?>