SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Duplicate Submissions

    I have a simple submission form for users to enter info into a db.

    It is getting lots of duplicates. How can I help prevent this?

    Thanks

  2. #2
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    What kind of content does your site have?

    To make things a little easier, let's pretend that you have an articles database. When a user tries to enter in an article, you could have PHP check to see if the title of the article already exists. If it does, then it tells the user that article is already in teh database. If there isn't already an article with that title in the database, then PHP inserts teh new record.

    Hope this helps!
    -Corbb
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't use something with spaces or that could be duplicated so easily.

    Say you have a subject, "Hey look!" and someone submitted the same thing but with "Hey look" it won't stop it since they're not the same.

    Until he says what kind of info he's storing in his database.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    Are you ready for BSD? Marshall's Avatar
    Join Date
    Dec 2001
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the strings that you're storing are free-form -- for example, "A way to draw circles" and "Whoa, check out this circle drawing technique" -- then your only real choice is to have a human review the list periodically. If you're receiving more submissions than you can handle yourself then now might be a good time to encourage community involvement. The administrators for sites like sitepointforums, for example, choose a few trustworthy individuals and give them the power to edit/modify content posted by others. This distributes the work load while (hopefully) ensuring that issues of applicability are handled correctly.

    - Marshall

  5. #5
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    West Columbia, SC
    Posts
    622
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advice so far.

    The application I'm working on is a event calendar. The users are submitting Native American Pow Wows.

    I have a calendar now using perl, but I'm writing in php. You can take a look at the old one at:

    http://www.powwows.com/cgi-bin/powwowcal.cgi

  6. #6
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What I'd do is create your table, have an id field, like powwow_id, make this your primary key, and an int.
    Also an auto increment would be useful.
    Then have the powwow_name, make this unique.
    Have your description field. You could make it a varchar as 255 characters should be sufficient for it's description based on that url.
    and finally your date field.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •