Menu

preventing double entries of same

Help
Fay
2008-12-31
2013-06-03
  • Fay

    Fay - 2008-12-31

    Hi

    the forms work great.

    I just wanted to know where and with what code do I need to prevent - same user name or user email entries.

    As is I can enter the same name or emails over and over...

    is it possible to add a ?  -

    $curnum ++;
       echo “<font color=’red’>” . $curnum . “. The email ‘”.$email.”‘ already exists!</font><br>\n”;

    thank you
     

     
    • TNTEverett

      TNTEverett - 2008-12-31

      Possible but a little more complicated than what you describe.
      First where are you going to prevent entries (file or SQL db or other)?
      Next you have to read the db before you can determine if the entry already exists.  This is not simple with the current form design if you want this to occur before submitting the form.  After submission is easier but it forces the user to re-enter the form data after submission. 
      Either way is a bit of custom work for your form but it is most certainly possible. 

       
    • Fay

      Fay - 2009-01-02

      Ah yes I imagine it would not be easy. But good to know that it is possible.

      For the scenario I'm thinking of, it would have to be - after submission (i imagine) .

      Example:

      A user is creating his profile, he chooses a pseudonym - clicks on submit and a message bounces back saying that that name is already in use and he needs to choose another. But the form does not reset for all the other entries he's made...just the pseudonym.

      ____________

      In the phpFprmGenerator downloaded form there are

      2 html's - form and confirm

      3 php's - install, processor, captchaSecurityImages

      Would the implemention of such a command require making changes in several code pages or just one - and which ones ?

       
      • TNTEverett

        TNTEverett - 2009-01-02

        Only the processor file.  You need to check the database first for duplicates of a field, then allow or not allow processing to continue. 

         
    • Fay

      Fay - 2009-01-03

      logical.

      thank you

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.