I want to implement something that doesn't allow the user to rate more than once
问题 I have used someone else's code that uses the ipaddress way. However, I would like to use a code that checks for the current userid and the id number. $ipaddress = md5($_SERVER['REMOTE_ADDR']); // here I am taking IP as UniqueID but you can have user_id from Database or SESSION /* Database connection settings */ $con = mysqli_connect('localhost','root','','database'); if (mysqli_connect_errno()) { echo "<p>Connection failed:".mysqli_connect_error()."</p>\n"; } /* end of the connection */ if