Jump to content

Recommended Posts

Hi have got this code.

tried to link it up with each profile but it shows error is the code correct?

 

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

      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];

}else {

$profile = mysql_fetch_array($LoginRS);

$MM_redirectLoginSuccess = "profile_" .$profile[0] ."php";

    }

 

Link to comment
https://forums.phpfreaks.com/topic/157174-solved-php-solution/
Share on other sites

Hi have got this code.

tried to link it up with each profile but it shows error is the code correct?

 

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

      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];

}else {

$profile = mysql_fetch_array($LoginRS);

$MM_redirectLoginSuccess = "profile_" .$profile[0] ."php";

    }

 

 

You're missing the DOT for .php...

 

So use this...

 

$MM_redirectLoginSuccess = "profile_" . $profile[0] . ".php";

 

 

Link to comment
https://forums.phpfreaks.com/topic/157174-solved-php-solution/#findComment-828214
Share on other sites

Thank you,but anytime i try to excute it shows profile_.php not found on the server but when i rename the file on my folder to profile_.php it shows.Please help me correct my code

this is my code

if (isset($_POST['Login'])) {
  $loginUsername=$_POST['Login'];
  $password=$_POST['Password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "profile_".$profile[0] .".php";
  $MM_redirectLoginFailed = "Login Failed.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_inteecom_ellen, $inteecom_ellen);
  
  $LoginRS__query=sprintf("SELECT Login,Password FROM `Customer Login` WHERE Login=%s AND Password=%s",
    GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "int")); 
   
  $LoginRS = mysql_query($LoginRS__query, $inteecom_ellen) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
    
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;	      

    if (isset($_SESSION['PrevUrl']))  {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	
    }}else {
	$profile = mysql_fetch_array($LoginRS);
	$MM_redirectLoginSuccess = "profile_".$profile[0] .".php";
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }

Link to comment
https://forums.phpfreaks.com/topic/157174-solved-php-solution/#findComment-828268
Share on other sites

Tried to adjust it this way but it takes all of them to the same page.Gosh.

 

if (isset($_POST['Login'])) {
  $loginUsername=$_POST['Login'];
  $password=$_POST['Password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "my profile.php";
  $MM_redirectLoginFailed = "Login Failed.php";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_inteecom_ellen, $inteecom_ellen);

  $LoginRS__query=sprintf("SELECT Login,Password FROM `Customer Login` WHERE Login=%s AND Password=%s",
    GetSQLValueString($loginUsername, "int"), GetSQLValueString($password, "int"));
   
  $LoginRS = mysql_query($LoginRS__query, $inteecom_ellen) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
   
    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['MM_UserGroup'] = $loginStrGroup;        

    if (isset($_SESSION['PrevUrl']))  {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];   
    }}else {
      $profile = mysql_fetch_array($LoginRS);
      $MM_redirectLoginSuccess = "profile_".$profile[0] .".php";
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }

Link to comment
https://forums.phpfreaks.com/topic/157174-solved-php-solution/#findComment-828278
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.