[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 390
  • Last Modified:

checking a login php script

I have a php login in script and it doesn't seem to work, I put the username in and password but it shows incorrect password or username.I know they are correct.
I checked my mysql with a test mysql and it is working,

But the login script does not seem to be connecting to the database.

My config file seems to be filled out correctly.

I am putting up my config file, login file.
If there is anything else you need let me know

This is just a test program so I am not worry about passwords they can alway be change
login.php
config.php
0
starview
Asked:
starview
  • 6
  • 2
1 Solution
 
rinfoCommented:
You should have included functions.php - which i understand defines doLogin() function.
0
 
starviewAuthor Commented:
0
 
starviewAuthor Commented:
for to enter it
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
rinfoCommented:
You have used password function in the query  for mysql.
This function has know to fail when password field is defined having  less then 15 varchar.
Just increase the field for password to varchar(16) and see if it works ok .
0
 
starviewAuthor Commented:
varchar is set at 32
0
 
starviewAuthor Commented:
That has been change in the function, but still does not connect.
0
 
starviewAuthor Commented:
I found my problem:
I changed :
$sql = "SELECT user_id
From tbl_user
WHERE user_name = '$userName' AND
user_password = PASSWORD('password')";

To

$sql = "SELECT user_id
From tbl_user
WHERE user_name = '$userName' AND
user_password = 'password'";
0
 
starviewAuthor Commented:
It was the only solution that would work
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now