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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:00:02+00:00 2026-05-20T20:00:02+00:00

Currently my team and I are working with Code Igniter 1.7.3 and we are

  • 0

Currently my team and I are working with Code Igniter 1.7.3 and we are not capable of using code igniter 2.0 with our project.

Anyway,

I made several php files in which one main files uses JQuery to load the other files inside a certain div in the main file. It goes something like this for example (They are both in the views folder in CI)

<!DOCTYPE HTML>
<html>

<head>





<script type="text/javascript" src="<?php echo base_url().''?>public/scripts/jquery-1.4.4.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){



    $("#insert-activity").load("<?php echo base_url().''?>system/application/views/bio.php");


});


</script>

<title>Title</title>

</head>

<body>

<div id="insert-activity"></div>



</body>


</html>

Now, it loads perfectly. The problem is the controller loads the profile view

<?php

class UserProfile extends Controller {

    function UserProfile()
    {
        parent::Controller();
    }

    function index()
    {
        $this->load->library('DX_Auth');
        $this->load->helper('url');
        $this->load->helper('form');
        $this->load->model('userprofile_m');
        $userID = $this->dx_auth->get_user_id();

        $friend_ids = $this->userprofile_m->get_friends_ids($userID);

        $data['interest'] = $this->userprofile_m->get_user_intersts($userID);
        //$data['broadcasts'] = $this->userprofile_m->get_broadcasts($userID);
        $data['friendID'] = $friend_ids;
        //$data['friendsBroadcasts'] = $this->userprofile_m->get_friends_broadcasts($userID,$friend_ids);
        $this->load->view('profile', $data);




    } ?>

The problem here is that I want some of the data retrieved to go to bio.php because profile.php will load the bio.php in the div.

And everytime I click on the get bio link I want it to retrieve the information again and put it in bio.php while JQuery loads bio.php in profile.php

Here is bio.php just in case

<!-- PHP should insert the user's bio here -->



<div id="activity-header" class="background"> <!-- activity header start DO NOT MODIFY-->

<h1>Bio</h1>

</div> <!-- activity header end DO NOT MODIFY-->



<div id="activity-feed"> <!-- activity div for JQuery  DO NOT STYLE THIS DIV-->

<div> <!-- name start -->
<div> <p <p class="special-p">Name:</p> <hr class="special-hr"> </div>
<p class="used-p">some guy</p>

</div> <!-- name end -->

<div> <!-- description start -->
<div> <p <p class="special-p">Description:</p> <hr> </div>
<p class="used-p">I don't like talking about myself... I'm emo .. for some reason</p>

</div> <!-- description end -->

<div> <!-- interests start -->
<div> <p class="special-p">Interests:</p> <hr class="special-hr2"> </div>
<p class="used-p">I am interested in:</p>

<ul>

<li>something</li>
<li>Food</li>
<li>Travel</li>
<li>Fishing</li>
<li>Pokemon</li>
<li>More Pokemon</li>
<li>POKEMOOONN!!!!</li>

</ul>

</div> <!-- interests start -->


</div> <!-- activity div for JQuery -->

This is the code that @kevtrout taught me. Still, the page wont load inside the div

this is the function bio inside the controller userProfile

function bio(){



        $this->load->library('DX_Auth');
        $this->load->helper('url');
        $this->load->helper('form');
        $this->load->model('userprofile_m');
        $userID = $this->dx_auth->get_user_id();

        $friend_ids = $this->userprofile_m->get_friends_ids($userID);

        $data['interest'] = $this->userprofile_m->get_user_intersts($userID);
        //$data['broadcasts'] = $this->userprofile_m->get_broadcasts($userID);
        $data['friendID'] = $friend_ids;
        //$data['friendsBroadcasts'] = $this->userprofile_m->get_friends_broadcasts($userID,$friend_ids);
        $bio_view = $this->load->view('bio',$data,true);
        return $bio_view;



    }

And this is the JQuery inside the view profile.php that wants to load thw view bio.php and send the data to .. This is immediatly done after the $(document).ready

$.post("<?php echo site_url('userProfile/bio');?>",{user_id: 777},function(){

        $("#insert-activity").html(data);

    },html);
  • 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-20T20:00:04+00:00Added an answer on May 20, 2026 at 8:00 pm

    1)
    I would probably create a controller/method which loads bio information then the bio view.
    then load that controller/method using your ajax.

    OK, you need to add a method called get_bio or something to your UserProfile controller. The function is pretty much the same as your index function, but it loads the bio view at the end instead of the profile view.
    Then change your JQuery to:

     $("#insert-activity").load("<?php echo site_url('userprofile/get_bio'); ?>");
    

    2)
    .. unless there is some reason why you really need to load the bio view using ajax, you can you just do

    <div id="insert-activity">
         <? $this->load->view('bio'); ?>
    </div>
    

    because then the data would be available in the bio view.

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

Sidebar

Related Questions

Our team is currently working on a large project which makes heavy use of
In the project my team is currently working on, we're modifying a commercial PHP
Currently our team of 11 people is working on a project on asp.net platform.
I'm currently working in a team where we're using a subversion repository. I say
I am currently working on a rather large project with a team distributed across
My team is currently trying to automate the deployment of our .Net and PHP
I am currently working on a project where a team of us are designing
Currently, we are working on a C++ legacy code base, which consists of several
When working remotely, our team only has access to our source code by remote
Our team is currently working on completely redesigning our school's website and one of

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.