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 8416339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:43:26+00:00 2026-06-10T01:43:26+00:00

first off third question I’ve asked and all have been answered well! So thanks

  • 0

first off third question I’ve asked and all have been answered well! So thanks to everybody who reads my posts (and others I guess)

I’ve gotten as far as I can without complete help on this one. I need to create a username and password section. I’ve done this before using htaccess, htauth files. Works well. Secure, and log’s them in fine. What I’m looking for though is some sort of script that will take a specific user to a specific page after login.

User1= user1.php
user2= user2.php

Ect.

Is this possible without a whole lot of work? I can make workarounds where the users login to the main index, then go where they need to, but then anyone logged in can go to anyone’s page.

I’m not asking anyone to write the code. But even some guidance to some tutorials would be great!

  • 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-06-10T01:43:28+00:00Added an answer on June 10, 2026 at 1:43 am

    If the page is authenticated using .htaccess, upon successful login the username is available as $_SERVER['PHP_AUTH_USER'].

    So you can either redirect the user using Location, or even better, directly include() the desired file.

    You can place the user1.php, user2.php, … files in a directory of their own, with a .htaccess that disallows direct access. This won’t stop PHP from being able to include the files, and this way only the authenticated user can have access to his file.

    if (isset($_SERVER['PHP_AUTH_USER']))
    {
        $pvdir = './user_private_files/';
        // "basename" in case we log in little Jack Folders (Bobby Tables's cousin)
        $user = basename(strtolower($_SERVER['PHP_AUTH_USER']));
        $file = $pvdir.$user.'.php';
        if (file_exists($file))
        {
            include $pvdir."any_common_code_at_the_beginning_of_user_files.php";
            include $file;
            include $pvdir."any_common_code_at_the_end_of_user_files.php";
            exit();
        }
        include ugly_error.php;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off - apologies if this or a similar question has been asked before.
First off, apologies if this question has been asked before but I couldn't find
First off--thanks for having a look. MY QUESTION In a .NET web app, is
First off, I'm a Paradox newbie. Secondly, I'm querying a database of a third-party
First off, the function in question. bool Animation::loadFrames() { sf::Texture frame[frameCount]; std::string pathToFrame; for(int
First off, I've never used GWT before. I have good experience in HTML/CSS/JS/JSP. I'm
If I have the following: <table> <thead> <tr> <th><a href=Index.cfm?Sort=0>First</a></th> <th><a href=Index.cfm?Sort=1>Second</a></th> <th><a href=Index.cfm?Sort=2>Third</a></th>
First off, does anyone have a comprehensive list of the Perl special variables? Second,
I have a problem, first off, I have a variable $num_newlines that changes to
I'm working on a DB/web based frontend, and have encountered an issue. First off,

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.