Outlaw782 Posted April 23, 2017 Share Posted April 23, 2017 (edited) 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 Edited April 23, 2017 by Outlaw782 Quote Link to comment Share on other sites More sharing options...
benanamen Posted April 23, 2017 Share Posted April 23, 2017 Your code is a classic example of everything to do wrong. The code is obsolete and has been completely removed from PHP. You need to use PDO and prepared statements. Quote Link to comment Share on other sites More sharing options...
capt1701b Posted April 24, 2017 Share Posted April 24, 2017 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 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 24, 2017 Share Posted April 24, 2017 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! Quote Link to comment Share on other sites More sharing options...
Strider64 Posted April 24, 2017 Share Posted April 24, 2017 I like this link https://phpdelusions.net/pdo, but I don't agree with everything they write. However, for the most part it's very informative and won't steer you wrong. (In my opinion) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.