I made login and sign up page using PHP and MySQL.
I skip the entire html code this time.
Here is the method to pass the data to php files.
<!-- for sign up -->
<form action="RegisterFlyer.php" method="get">
</form>
<!-- for login -->
<form action="ValidateUser.php" method="get">
</form>
Let's take a look at Sign up system first.
Sign up
I checked the email and password confirm first.
For connecting this php file to our database we use the code:
require_once("config.php");
So, we call the config.php for connecting current php file to database.
We are gonna check whether same email exist in the database or not.
$row gets the every row in the database.
If one of the row includes same email, then we exit the databast, sending the message.
If there is not same, then we execute the query.
(The NULLs are for the different information for other pages such as location, zip code...)
Login
It almost same step with Sign-up.
- Call the config file again
- Execute the query(This time, we use SELECT * FROM ~ ==> to check the already existed data)
If there is no row from the table, it means we don't have that email already registered.
If we got the row, we put the ID in session.
'Web Programming π > Database π©π»βπΎ' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
Postgresql SELECT & DELETE (0) | 2023.05.07 |
---|---|
Ubuntu Server, postgresql (0) | 2023.05.04 |
PHP + SQL (0) | 2023.05.02 |
Basic SQL (0) | 2023.04.28 |
MySQL Command (0) | 2023.04.13 |