Jump to content

Login button not working -- Brand new to php


Outlaw782

Recommended Posts

So I am trying to connect  a login page to a database I have made already in phpmyadmin. There is one row in this database which includes the username and password already. However, when I type those credentials in, and click the login button oh my login.php page, the page accepts the credentials, but doesn't throw an error/success message back to me. Been looking for countless hours online, finally I decided to come here

login.php

process.php

style.css

Link to comment
Share on other sites

Welcome to the php forum,

 

Looking at your code, you have not added code to say when click login do x,y,z

 

for example

 

if (isset($_post['login']))

{
 
then what you want to happen after login has been pressed

}

 

 

the logic is "has login been pressed? "

 

"yes" then run the code, 

 

mysql has been superseded by mysqli https://www.w3schools.com/php/php_ref_mysqli.asp

 

www.w3schools.com is a good site to learn about php for beginners

Link to comment
Share on other sites

Please ignore the captain's post. His code is not much better than the code you have copied form elsewhere.

 

Take the first advice - dump the code you have, read up on how to use PDO instead of MySQL and then do a little reading or maybe take a tutorial and LEARN how to code.

 

PS - you button and inputs will be retrieve via the $_POST array, not $_post, since PHP is CASE-SENSITIVE!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.