Login system for drawing in php

Asked

Viewed 765 times

-1

I need to create a login system for a draw page. The user has to be the number that will be drawn, this information will already be fed in the BD, then the user would enter this number and email to log in and have access to the content of the page. For example when loading the page will have the code field of the draw and e-mail, then this code will already be in the BD and he would need to feed only with his e-mail and ready would be already logged in. Any idea on how to create this login that works as a register too?

  • There’s something already done, code, bank structure

2 answers

1

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

For this you can use Oauth because this protocol allows you to access the account data and get the user’s email with your permission.

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

The Oauth protocol is a little complicated and that’s why I wrote a Oauth client class in PHP to simplify the process of authorizing and accessing Oauth-based Apis such as Facebook, Google, etc. Here’s the first and the second part of a Portuguese tutorial on this subject.

0

from what I understand you will have to do the following, this 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());

}
  • Okay, I think I get it, I’m going to try here, because I built a login system, based on this link And now I will implement the email confirmation, because when the email has not registered in the login page itself I will register the email and send the confirmation.

  • you say send a confirmation by email? for it click on the link and confirm the registration?

  • Exactly confirmation of e-mail!

  • To do this you need to store the information in a temporary table, in this table you would put the email of the encrypted person, example with md5. After this you make php send an email to the person with an example confirmation link: www.site.com/valida.php? email=fsd56f4fsdf564sd6f4 where the get value would be the email of the encrypted person, so the person open this link you check the email and if it is correct you transfer all the data from it that is in the temporary data table to the access table.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.