Jump to content

Login button not working -- Brand new to php


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




Edited by Outlaw782
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

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.