Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Raffle script to reward Voters

  1. #11
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    There isn't anything too easy to do that, but you could filter the email list for duplicates then select from the others. That would be done manually, but it's certainly possible. The easiest way would be to select an email address as the winner. Then remove it from the list. Then search the list for that same email (edit>find, or the equivalent). If you find it, start over and look for a new non-duplicated email. If you don't find it, then that person entered just once.

    It's also possible to read the file using PHP, split at each line, then actually sort through them-- remove duplicates, then pick a random one, all using PHP. But unless you'll be doing it often, it'll probably be faster for you to just do it yourself rather than try to code that.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #12
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default

    Thanks djr33, I did not think that it would be easy but I was curious to ask the question. Thanks for the clarification.

  3. #13
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    By the way, if you're using a database (or know how to deal with searching for information in text files in PHP), then you could do this automatically. But based on the way you're approaching it, it would be easier to look through yourself -- I just wanted to add that it is completely possible if you design the website another way.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #14
    Join Date
    Aug 2011
    Location
    Rep Of Ireland
    Posts
    126
    Thanks
    24
    Thanked 3 Times in 1 Post

    Default

    Yes, I will be using a manual approach as I am only expecting 500 to 1000 entries. I am sure a short period of my time with Edit>Find would sanitize the file of any multiple inputs.

    I thought that it was however good to have gone through this with a flatfile approach as it would be easy to replicate again and again for a small job running for a short period. I might be expressing a primitive view here - but the learning curve was not to steep! You might have a different opinion on that!

    Onwards and upwards, I will soon be wrestling with SQLite and who knows my opinion on flatfiles might then change.

    By the way I found this great Demo on using Flatfiles as a database at: http://www.designdetector.com/archiv...eDemo.php#demo
    Last edited by Webiter; 11-14-2011 at 11:14 AM. Reason: Adding details of link to FlatFileDatabaseDemo

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •