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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:13:38+00:00 2026-05-29T12:13:38+00:00

Thsi does not seem to work: $msg=Your changes have been saved successfully; $view=include(‘application/view/admin/cms/_slides-current.php’); $return_array=array(‘success’=>true,

  • 0

Thsi does not seem to work:

$msg="Your changes have been saved successfully";

$view=include('application/view/admin/cms/_slides-current.php');

$return_array=array('success'=>true, 'msg'=>$msg, 'view'=>$view);

echo json_encode($return_array);

The array needs to be passed back to a jQuery ajax success callback. Anybody know how it should be done?

The include file is simply a HTML template. This HTML template will be inserted on to the page.

Is there any way other than using json_encode() to do what I am trying to do?

success: function(result){
    alert(result.msg);

    if(result.success == true)
    {
        $('#slides').html(result.view);
    }
}
  • 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-29T12:13:40+00:00Added an answer on May 29, 2026 at 12:13 pm

    include is a statement and not a function (disregard the function.include.php part). It will not return the parsed result to your $view variabe, although the file will be included just above your json_encode.

    You should use ob_start to capture the evaluated result of the view in the manner described by mihneasime:

    ob_start();
    include 'application/view/admin/cms/_slides-current.php';
    $view = ob_get_clean();
    ob_end_flush();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a not custom table view view that i mean that i'm using
I have created a ipad offline application. The safari shows internet connection not available
So I need to pull the e-mail addresses of members who have not logged
This is a big-picture question... but I also have details on the problem I
i am retrieving different characters from a string by using thsi function and adding
I have an install script on my website, and when i run it, it
I have a need to iterate over all of the tables in my database.
Im a budding iphone developer, and doing my best but i have a query
In thsi example: int a[2][2]={{1,2},{3,4}}; int *p=a[0]; cout<<p; cout<<&a[0][0]; Both gives the same output.
I have a simple test project in Spring 3, basically a method within the

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.