Answer the question
In order to leave comments, you need to log in
How to hide a form by defining a user and their selection?
Items have ratings. The user can vote, but the rating remains visible. After voting, the rating should be locked so that the user does not vote again. From the form I pass the values 'stars_id' 'cookie' 'val' to the table using ajax. How to do data validation and select input to close?
$ra1 = $row['rating'];
$checked = intval($ra1);
$count = 5;
$inputs = '';
for($i = 1; $i <= $count; $i++) {
$checked_attr = $i == $checked ? ' checked' : '';
$inputs .= '<input class="rating-input" id="mod' . $i . '' . $row["products_id"] . '" star-attr="' . $row["products_id"] . '" name="radio-rating" type="radio" value="' . $i . '"' . $checked_attr . '>';
$inputs .= '<label class="rating-star" for="mod' . $i . '' . $row["products_id"] . '" ></label>';
};
// вывод
echo '
<div class="order_right">
<div class="wrap_stars">
<form class="form-rating" method="POST">
<fieldset class="fieldset">
<legend></legend>
<div class="rating-group">
' .$inputs . '
</div>
</fieldset>
<div class="count_block">
<!-- Статистика -->
<ul class="count" >' . $row["rating"] . '</ul>
</div>
</form>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
I'm not a guru, of course, but if you create an array and enter the user ID there, and then compare them?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question