Jump to content

Voting System with Verification


snwspeck

Recommended Posts

Basically I am writing my own voting system but I have a few problems and I would like to address them all in one post rather than three.

 

First:

The first thing I need help with is using CURL to check if a user actually voted at the remote top list website.

 

Two:

I need maybe a source script of a 10 digit hash generator that will display the hash generated and will insert it into the database

 

This is currently what my hash generator looks like but I need someone to help me change it so that it will echo the actual hash generated and inserts it into the database,

 

<?php
function gen_md5_password($len = 6)
{
    return substr(md5(rand().rand()), 0, $len);
}
?>

 

Three:

I need some sort of way to tell the database that if they hash is not used within 24 hours, it will just dump or delete.

Link to comment
Share on other sites

Basically I am writing my own voting system but I have a few problems and I would like to address them all in one post rather than three.

 

First:

The first thing I need help with is using CURL to check if a user actually voted at the remote top list website.

 

Two:

I need maybe a source script of a 10 digit hash generator that will display the hash generated and will insert it into the database

 

This is currently what my hash generator looks like but I need someone to help me change it so that it will echo the actual hash generated and inserts it into the database,

 

<?php
function gen_md5_password($len = 6)
{
    return substr(md5(rand().rand()), 0, $len);
}
?>

 

Three:

I need some sort of way to tell the database that if they hash is not used within 24 hours, it will just dump or delete.

 

I'm only going to reply with some theory for you to think about:

 

1. I would recommend using AJAX instead of CURL

 

2. I would go with nafetski's suggestion for your 'uniqid', If you really want to get crazy you can MD5 hash your uniqid ;)

 

3. There are two ways I would go about achieving your last request:

    a. Using a chron that you can run every hour/day/year...etc and deletes all hashes older than 24 hours

    b. Put something in the script that uses the hash that deletes it before use if it's 24hours old

 

for the hash stuff you will be working with the date() function most likely, although there are other options you can look into.

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.

Guest
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.