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

  • SEARCH
  • Home
  • 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 7803601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:38:16+00:00 2026-06-02T01:38:16+00:00

In one of my CI application there is an user login section. The users

  • 0

In one of my CI application there is an user login section. The users are restricted to some pages , ie only members can view that page. So there are two controllers users ( which contain register , login .. ) , admin ( secure pages ) .

My question is if user visit a page on admin then if that user is not logined then have to show login page ( in users controller ) and after successful login it will redirect to the previous page in which user tried to access.

for eg : If user click “myaccount” page then if user is not logined it will redirect to “login” page after successful login will return back in “myaccount” page

Please help
Thanks

  • 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-02T01:38:18+00:00Added an answer on June 2, 2026 at 1:38 am

    in the first create page >>name login.php in the view folder

    and write your login page

    in the controller you can try this code

    public function mypage()
        {
        $this->user_model->check_user_login();
    
        $this->load->view('cp/tamplate_header');
        }
    

    and write rhis code in the User_model

    function check_user_login()
    {
        if(! $this->session->userdata('logged_in'))
        {
            redirect('login');
        }
    
        if($this->session->userdata('user_active') == false)
        {
            redirect('pagename');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a user logs into my application, there are some menu items that I
So I have an application that allows a user to pick one of three
I have made a swings application but there is one problem in that which
I am trying create a small web application that allows a user to login
I have one requirement to fulfill. Actually when ever user Login into my application
Let's say there's an application that creates an account in AccountManager. User explores the
In my application there are 2 options to open the app. One of them
In my application one frame is there on which one button is there. If
Is there a way to embed one silverlight application in another silverlight application? if
I have a simple Crud application where there is one filed called Category. During

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.