Jump to content

PHP Voting script (really need help here)


Recommended Posts

Hi guys, I'm really a newbie to php, hope you guys can help me over here. I'm having problem with my voting scripts that i got it from 3rd party. The voting system currently only allow the voters to vote once as their IP address is being saved in the database and the voter will not be able to vote again.
I will like to modify the script to allow the voters from the same ip to vote once per 24 hours. I search a few tutorial helps which states that setting the cookie will allow same ip to vote once per day.But really newbie and dont understand how it works... Please help me thanks!  :D

include "connect.php";
$ipchecks="SELECT*from P_ip where IP='$s'";

    print "You have already voted in this poll";
        $ipinsert="Insert into P_ip(IP) VALUES('$s')";
      $vote = "UPDATE P_choices SET votes=votes+1
WHERE ID = '$ID'";
        print "Thanks for voting, <A href='poll.php'>Back to poll</a>";

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.