0
Is this how you make a login from a get method? I already have the data base and i'm using MYSQL.
4 Answers
+ 3
Here is some information from guru99 that might be helpful...
https://www.guru99.com/php-forms-handling.html
+ 2
First of all, you shouldnt use $_GET here but you should use $_POST otherwise the login details would be visible in the adress.
You have included your database connection, but youre not doing anything with it. The database connection object has a query method that allows you to pull information from the database.
So what you should do:
-Use POST to pull the data from the submitted form. (Make sure to change this in the form)
-Make a query to the database that pulls the login information from that user and compares it to what has been submitted in the form.
-Create a session if the details match that saves the username or the email.
You can load this session on all of your pages and change the contents of your pages based on whats in your session. This is possible since you can check if a session exists.
Hope this helps
+ 1
And thank you too BroFar.
0
Can you show me what would that look like in code? If possible, with comments, to help me figure out what does what. Thank you a lot, for your attention.