Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3696682
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:46:07+00:00 2026-05-19T04:46:07+00:00

Since the question is a bit vague and unclear, I will clarify what I

  • 0

Since the question is a bit vague and unclear, I will clarify what I mean in the following sentences.

The main page of my website is called index3.php and in there, there is the appropriate log in form which requires username and password fields for the user to log in.

What I am trying to do but I couldn’t manage yet, is on submit to be redirected in index3.php but instead of the log-in form to see text saying “Logged-in as:” in the log-in div. In other words replacing the form with Dynamic Text in the same div the form was in previously. Currently what it does is to redirect you to another page called login.php.

here is the php-code of the index3.php

   <?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['username'])) {
$loginUsername=$_POST['username'];
$password=($_POST['password']);
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "login.php";
$MM_redirectLoginFailed = "index3.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_ideatedb, $ideatedb);

$LoginRS__query=sprintf("SELECT username, password FROM users WHERE username=%s AND password='".md5($_POST['password'])."'",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 

$LoginRS = mysql_query($LoginRS__query, $ideatedb) 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 );
}
}
?>

Any help or direction will be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:46:07+00:00Added an answer on May 19, 2026 at 4:46 am

    This line determines where you are redirected:

    $MM_redirectLoginSuccess = "login.php";
    

    So if you want to go to index3.php, just change login.php to index3.php.

    Then, you’ll have to alter index3.php to display the signed-in message instead of the login form. As far as I can tell, this happens in a part of the file you haven’t supplied, but the basic idea would probably be like this:

    <aside>
      <?php if ($_SESSION['MM_Username']): ?>
        hello, you're signed in as <?php echo $_SESSION['MM_Username']; ?>
      <?php else: ?>
        ...existing login form in index3.php...
      <?php endif; ?> 
    </aside>
    

    (In case you’re confused by the lack of curly braces, I used the alternative syntax for control structures, because it’s slightly nicer when writing spaghetti code.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

since I couldn't find an answer to this question I researched a bit further
I'm rewording this question since I understand a bit more now. Originally, what I
I know this is a vague question, especially since I am not providing any
First, let me apologize for asking a question that may seem a bit vague
My question is a little vague at the moment since I'm not sure that
UPDATED QUESTION Since the ctor is not supported by .NETCF (public FileStream(IntPtr handle, FileAccess
Newbie question since I'm not up to speed using maven at all. I'm trying
Sorry since this question is specific to my problem. While learning reflections i did
UPDATE : Since this question is getting some views, I figured I'd better highlight
Edit (2012-04-12): Since this question was asked it is now possible (as of jQuery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.