Jump to content

my login page is not working in live server


vj_maple

Recommended Posts

Hi,

 

  i am currently working on a bidding site.The problem i have it here is in login section.Actually my login script works well in my localhost but in live server its not working.Can anyone give me the solution for this.Here's the script

 

if( isset( $_POST['usernam'] ) && isset( $_POST['password'] ) ){  // Added by Mhike

  if(strlen($_POST['usernam']) > 0 && strlen($_POST['password']) > 0 ){

    //validate fields

    $usr = trim($_POST['usernam']);

    $pwd = trim($_POST['password']);

 

    $pwd = DeCrypt($pwd,$rc4Key);

 

    //login check

    $q = " SELECT idCust, username, status

        FROM customer

        WHERE username = '$usr'

        AND password = '$pwd'

        ";

 

    $rs = $dba->Execute($q);

 

    if($rs){

    $res = $rs->FetchObject(false);

    }

 

    if($res->username == false){

      $err = 'User name or password is invalid!';

    } else if(strtolower($res->status) == 'i'){

        $err = 'Your account is not yet activated, please check your email and activate your account!';

      } else {

 

        //log to main page

 

        $_SESSION['user'] = $res->username;       

        setcookie("user_cookie",$_SESSION['user'],time()+60*60*24*30);

        $_SESSION['user_id'] = $res->idCust;

 

        header('Location: index.php');

 

      }

 

  }

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.