Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

dreamweaver login redirect not working

Guest
Dec 20, 2014 Dec 20, 2014

My website was working fine but there some problems with hosting. they informed to change my database username and password. after I changed my username and password I can not log in to my site to insert data. When i click sign in the browser loads the same login page again. Surprisingly everything works fine locally but I can not login on my live website. Hope some one help me

<?php

// *** Validate request to login to this site.

if (!isset($_SESSION)) {

  session_start();

}

$loginFormAction = $_SERVER['PHP_SELF'];

if (isset($_GET['accesscheck'])) {

  $_SESSION['PrevUrl'] = $_GET['accesscheck'];

}

if (isset($_POST['User_Name'])) {

  $loginUsername=$_POST['User_Name'];

  $password=$_POST['User_Pass'];

  $MM_fldUserAuthorization = "";

  $MM_redirectLoginSuccess = "post-list.php";

  $MM_redirectLoginFailed = "../index.php";

  $MM_redirecttoReferrer = false;

  mysql_select_db($database_afghanistan, $afghanistan);

 

  $LoginRS__query=sprintf("SELECT User_Name, User_Pass FROM users WHERE User_Name=%s AND User_Pass=%s",

    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));

  

  $LoginRS = mysql_query($LoginRS__query, $afghanistan) or die(mysql_error());

  $loginFoundUser = mysql_num_rows($LoginRS);

  if ($loginFoundUser) {

     $loginStrGroup = "";

   

    if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}

    //declare two session variables and assign them

    $_SESSION['MM_Username'] = $loginUsername;

    $_SESSION['MM_UserGroup'] = $loginStrGroup;         

    if (isset($_SESSION['PrevUrl']) && false) {

      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   

    }

    header("Location: " . $MM_redirectLoginSuccess );

  }

  else {

    header("Location: ". $MM_redirectLoginFailed );

  }

}

?>

TOPICS
Server side applications
644
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 21, 2014 Dec 21, 2014
LATEST

So you changed your credentials in your remote database? Did you also update the credentials in your CONNECTIONS file?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines