1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How Can I Make A Comment/Answer Box That Limits A Person To Post Only 1 Comment?

Discussion in 'HTML & Website Design' started by Billy16coolkid, Feb 22, 2012.

  1. #1
    How Can I Make A Comment/Answer Box That Limits A Person To Post Only 1 Comment/Answer To A Question Instead Of Multiple Comments/Answers From The Same Person?

    Because I Am Thinking Making A Website Like Yahoo Answers On Weebly

    Any Help Or Advice?
     
    Last edited: Feb 22, 2012
    Billy16coolkid, Feb 22, 2012 IP
  2. Billy16coolkid

    Billy16coolkid Greenhorn

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Any Help Please.
     
    Billy16coolkid, Mar 9, 2012 IP
  3. ketting00

    ketting00 Well-Known Member

    Messages:
    772
    Likes Received:
    27
    Best Answers:
    3
    Trophy Points:
    128
    #3
    If you use PHP, that would be simple. Just check if row >= 1. If so, disable comment.
     
    ketting00, Mar 10, 2012 IP
  4. 137th Gebirg

    137th Gebirg Active Member

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    I've seen many sites try this and it never really works. Most places use cookies to call back to the user to see if they posted already. That works fine & dandy unless the cookie expires, or the user's browser has cookies turned off or clears them out whenever they shut the browser down.

    A more complete way is to force your users to log-in before posting a comment. That way, you could restrict what they can post. But, since there are always ways around everything, your users might have multiple logins to foil this restriction. Then you will have to get into IP/MAC address filtering and all kinds of other NetSec nastiness that melts my brain.

    You get the picture...
     
    137th Gebirg, Mar 13, 2012 IP
  5. VPSVolt

    VPSVolt Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You would have a few options.

    One would be IP based. The other would be Username based.

    The IP based one would be useful if you don't have a registration system on the website and any of the people that are going to be posting are going to be anonymous. Basically you will want to get the users IP and the system will detect if the IP has answered a certain question by checking it against a table in MySQL if it has answered it will detect this and stop them from answering again by locking the question for them.

    Easiest way to create the IP based option would be to give each question a unique ID in the databases tables. Attach another field called answered IP's at the side and any IP's that click submit on the answer will be added to this field. Upon loading the question page there will be some PHP that checks the users IP against the database table. If the IP exists inside the database table some PHP will run telling the site to prevent the user from posting again. Possibly by removing the submission's text box and button.

    The username base would be the harder and best method to use. It would require you to create a registration system for the website and just like the IP based option it will detect if the user has posted on the question rather than the IP. Basically using the same principles.

    Again you would have to do something similar to what i mentioned above. Comparing the users ID against question ID in the database to see if they have previously answered the question.

    Hope this give you a few ideas about how this could be achieved.

    Thanks, VPSVolt.
     
    VPSVolt, Mar 14, 2012 IP