php signup code
Signup page
This code is in desperate need of functions. Not worrying about that right now. This would make it more accessible as an API for the AJAX, but these pages aren't APIs yet, just test code to flesh out the basics.
Anyway, once the page has been submitted, the php checks to see that all fields were filled in, that the password confirmation matches the password, and that the email address contains at least one letter, an @ symbol, and at least one other letter (not very sophisticated, but this project isn't about form error checking, and anyway email address is only for forgotten passwords).
If everything checks out, the values are entered into the database and the login variables are created on the session ($_SESSION['logged_in'], $_SESSION['username'], and $_SESSION['userid']). Try creating an account, logging out, then logging in--it works together! *happy working code dance*
(ugly,ugly) source
This code is in desperate need of functions. Not worrying about that right now. This would make it more accessible as an API for the AJAX, but these pages aren't APIs yet, just test code to flesh out the basics.
Anyway, once the page has been submitted, the php checks to see that all fields were filled in, that the password confirmation matches the password, and that the email address contains at least one letter, an @ symbol, and at least one other letter (not very sophisticated, but this project isn't about form error checking, and anyway email address is only for forgotten passwords).
If everything checks out, the values are entered into the database and the login variables are created on the session ($_SESSION['logged_in'], $_SESSION['username'], and $_SESSION['userid']). Try creating an account, logging out, then logging in--it works together! *happy working code dance*
(ugly,ugly) source


0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home