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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:19:43+00:00 2026-06-16T22:19:43+00:00

i have a simple ajax call which returns html codes, //=======-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-==-=-==-=-=-=-= //SEARCH Submit ===============================================================================

  • 0

i have a simple ajax call which returns html codes,

//=======-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-==-=-==-=-=-=-=
//SEARCH Submit ===============================================================================
$('.clicked_search').live("click",function() {
var from = $('#from').val();
var to = $('#to').val();
var sel = $('#sel').val();

var BegDT = new Date(from);
var EndDT = new Date(to);
var sum = BegDT - EndDT;
alert (BegDT +" b"+ EndDT +" e"+ sum);
if(sum > 0 | from == "" & to != "" | from != "" & to == ""){
$('.inv_date').show();
}
else{
    $("#app_panel").html('<div id="flash" align="left"  ><img src="img/clientimg/ajax.gif" align="absmiddle">&nbsp;<span class="loading">Loading Request...</span></div>');
    $("#clock").html('<div id="flash2" align="left"  ><img src="img/clientimg/ajax.gif" height="15px" align="absmiddle">&nbsp;<span class="loading"><font size="1">Loading Request...</font></span></div>');
    $.ajax({
        type: "POST",
        url: "database/clientpanel/logs/search_call_log.php",
        data: {
            from: from,
            to: to,
            sel: sel
            },
        cache: false,
        success: function(html){
            $("#flash").hide();
            $('.inv_date').hide();
            $("#app_panel").append(html);
        }
    });
    $.ajax({
        url: "database/clientpanel/logs/search_clock_log.php",
        cache: false,
        success: function(html){
            $("#flash2").hide();
            $('.inv_date').hide();
            $("#clock").append(html);
        }
    });
}   
return false;
});

but i also want it to return values that was produced from the php which the ajax called,

session_start();
include("../../dbinfo.inc.php");

// connect to the database
  $client_id = $_SESSION['clientid'];
//===========THIS PHP VALUES RIGHT HERE===================================
      $out = 0;  
      $in = 0;
      $ext =0;
      $min = 0;
      $sec = 0;
//====================================================================
  $query=" select * from call where client='$client_id' ORDER BY date_time DESC";
  $result = $mysqli->query($query);

how can i return the “html code” together with the “php values” using one ajax call?

  • 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-16T22:19:44+00:00Added an answer on June 16, 2026 at 10:19 pm

    You could transfer your data in a JSON format.

    Within your PHP, you’ll build an array with all the data you want to pass back for the AJAX call.

    $results = array(
      'html' => $html,
      'variable1'=>'value1',
      'variable2'=>'value2',
      ...
    );
    

    Now you encode this array into a JSON format using json_encode() –

    $jsonString = json_encode($results);
    echo $jsonString;
    

    This is the value that you echo out of your PHP.

    Now in your jQuery $.ajax request, you’ll need to specify the dataType:json, and you’ll be able to access all the parameters in your success callback –

    $.ajax({
      type: "POST",
      dataType: "json",
      ...
      success: function(data){
        ...
        $("#app_panel").append(data.html);
        // also available :
        // data.variable1 and data.variable2
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple jquery/ajax request to the server which returns the structure and
I have written a simple jQuery.ajax function which loads a user control from the
I have a search page which uses a simple ajax request to get new
I have a search that returns JSON, which I then transform into a HTML
I have a function which makes an AJAX request to a server and returns
I have a simple form which updates values in the db via ajax call
I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
I have an ajax call which returns a partial view which I want to
I have a simple ajax call inside a javascript function to a php file,
I have made a simple code for ajax to call a page but it

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.