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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:40:57+00:00 2026-06-05T09:40:57+00:00

localhost/backend/administrator/authentication/8218/0 In codeigniter, I want to fetch these values 8218 and 0. My code

  • 0

localhost/backend/administrator/authentication/8218/0

In codeigniter, I want to fetch these values 8218 and 0.

My code is:

class Administrator extends Controller {

function Administrator()
    {
            parent::Controller();
            $this->load->library('uri');
    }

function authentication()
    {        
        echo $seg1= $this->uri->segment(3);
        echo $seg2 = $this->uri->segment(4);
        echo $this->uri->total_segments(); 
    }

}

I am not getting any output, but I got out put as ‘0’ when I used $this->uri->total_segments();

my config.php 

'AUTO'          Default - auto detects
| 'PATH_INFO'       Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'     Uses the REQUEST_URI
| 'ORIG_PATH_INFO'  Uses the ORIG_PATH_INFO
|

$config['uri_protocol'] = "AUTO";

i am using .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /backend/

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]    

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule> 

Can any one find out my mistake and suggest me the correct code.

  • 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-05T09:40:59+00:00Added an answer on June 5, 2026 at 9:40 am

    You don’t need to load the core library. It has been loaded automatically for you. Remove the following line from the constructor, and everything should be working.

    $this->load->library('uri');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails backend and am testing the following jquery code against it:
I'm a beginning Magento programmer. I used to access the backend as localhost/magento/admin and
Being a GWT newbie, I want to create GWT frontend and a PHP backend,
This is what I'm doing: $.ajax({ url:localhost:8888/check_app, success:function(data) { alert(success!); callback(data); }, error:function(data){ alert(JSON.stringify(data));
I am working on a localhost app which is backed by a MySQL database.
http://localhost:8080/file.jsp?arg1=&arg2=11 runs successfully http://localhost:8080/file.jsp?arg1=&arg2= (empty value for argument 'arg2') shows 500 Internal Server Error
From the page file://localhost/Users/pistacchio/dev/epress/catflow/test_html/index.html I have the following (coffeescript) code trying to access an
$con = mysql_connect(localhost,music123_sri,password); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db(music123_telugu,
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I am running a localhost instance (so domains are not my issue!) on my

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.