Jump to content

login script:problem


cool_techie

Recommended Posts

I have a login script which is showing problem.

The problem is that when my username and password are correct it directs to index.php page and displays the correct username there.

But if the password is wrong it still directs to the same page instead of different(err-login.php) page,but this time no username is displayed.

 

index.php:

the password verifying code is as follows(the whole code of index.php is not mentioned since it is too long and a bit messy)

<code>

 

<?php

$connection=mysql_connect("localhost","root","");

mysql_select_db("forum",$connection);

$select=mysql_query("SELECT * FROM user_id WHERE uname='$_REQUEST[uname]'",$connection);

$row=mysql_fetch_array($select);

if($row['password']==$_REQUEST['password']){

session_start();

$_SESSION['name']=$_REQUEST['uname'];

}

else{

header("Location:err-login.php");

}

?>

</code>

 

NOTE:-The name of my db and table are correct.

I have referred to username as uname.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

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