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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:38:48+00:00 2026-05-27T08:38:48+00:00

In my codeigniter application i want to display the uri segments.Iam using ajax to

  • 0

In my codeigniter application i want to display the uri segments.Iam using ajax to call controller.
This is my html code

function add_store(){
            var path="<?php echo base_url()?>images/loader.gif";
            $("#add_store").html("<div align='center' style='margin-top:200px;'><img src="+path+" style='width:25px;' /></div>").show();
            $.ajax({  
                type: "POST",  
                url: "<?php echo base_url();?>index.php/Admin/add_store/",
                success: function(msg){
                $("#add_store").html('');
                $("#add_store").html(msg).show();
                }  
            });
}

This is my controller code

public function add_store()
    {
        echo $this->uri->segment(3);
    }

nothing will be displayed.How can i get uri segments?
If i use

echo $this->uri->segment(1);

Then it displays Admin but after 1 nothing will be displayed.

  • 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-27T08:38:48+00:00Added an answer on May 27, 2026 at 8:38 am

    Looks like your controller ‘Admin’ is calling a method ‘add_store’, but there are no further segments, that’s why your 3rd one isn’t passed.

    1st segment: “Admin”

    2nd segment: “add_store”

    I don’t know what you want to achieve, but if you have an url like:

    admin/add_store/someparam/someotherparam
    

    you would just do

    public function add_store($param1, $param2)
    {
        echo $param1; // 'someparam'
        echo $param2; // 'someotherparam'
    }
    

    without the need to call directly the uri segment.

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

Sidebar

Related Questions

I am using CodeIgniter in my application. I have a code like this $this->db->where('a.PreferenceID
I want to submit a form using jQuery in a CodeIgniter application. However, the
I want to redirect to www.yahoo.com from my codeIgniter application. I write code like
I'm developing web application using CodeIgniter. All this time, I put the custom js
i want to port my application to CodeIgniter but i am wondering whether i
I am using Codeigniter to develop an application, and have been reading bits about
In CodeIgniter I'm using a base CRUD My_model , but I have this small
I already have an express checkout integrated with my Codeigniter application. Now I want
I've recently refactored an existing CodeIgniter application to use url segments instead of query
I am using codeigniter php MVC framework to develop a web application. I have

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.