Login system for drawing in php [closed]

-1

I need to create a login system for a drawing page. The user has to be the number that will be drawn, this information will already be fed into the BD, then the user would enter with that number and the email to log in and have access to the page content. For example when loading the page will have the field code of the lottery and the email, then this code will already be in the database and he would need to feed only with his email and it would be already logged in. Any ideas on how to create this login that works as a registry too?

    
asked by anonymous 08.03.2014 / 18:38

2 answers

1

I think that simpler than making a complete registration system with email validation, would you allow the user to identify with your Facebook, Google, Microsoft, Yahoo, etc. account.

For this you can use OAuth because this protocol allows you to access your account data and obtain the user's email with your permission.

Then you already create the user account on your site if the email does not already exist in your database.

The OAuth protocol is a bit tricky, so I wrote myself a

11.03.2014 / 04:51
0

From what I understand you will have to do the following, assuming you are using mysql:

$numero = "numero do sorteio";

$email = "email digitado";

$sql = mysql_query("SELECT * FROM tabela WHERE numero = '{$numero}'") or die (mysql_error());

if(mysql_num_rows($sql)){

    $sql = mysql_query("UPDATE tabela set email = '{$email}' WHERE numero = '{$numero}'") or die (mysql_error());

}
    
09.03.2014 / 21:02