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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:28:18+00:00 2026-05-24T17:28:18+00:00

My script runs fine and it alerts me the data is saved. but for

  • 0

My script runs fine and it alerts me the data is saved. but for Debug reason I want to see the PHP (“Procees.php”) response as well in html format.
I can see it in firebug but I do not know how to out put it using jquery.
My codes are as follows;

            var dataString ='doctype='+ doctype + '&paytype=' + paytype + '&docno=' + docno + '&bookno=' + bookno + '&prname=' + prname +'&pename='+pename+'&paydate='+paydate+'&inpdate='+indate 
        +'&e1='+e1 +'&e2='+e2 +'&e3='+e3 +'&e4='+e4 +'&e5='+e5 +'&e6='+e6 +'&e7='+e7 +'&e8='+e8 
        +'&accname1='+accname1 +'&accname2='+accname2 +'&accname3='+accname3 +'&accname4='+accname4 +'&accname5='+accname5 +'&accname6='+accname6 +'&accname7='+accname7 +'&accname8='+accname8 
        +'&dr1='+dr1 +'&dr2='+dr2 +'&dr3='+dr3 +'&dr4='+dr4 +'&dr5='+dr5 +'&dr6='+dr6 +'&dr7='+dr7 +'&dr8='+dr8
        +'&cr1='+cr1 +'&cr2='+cr2 +'&cr3='+cr3+'&cr4='+cr4 +'&cr5='+cr5 +'&cr6='+cr6 +'&cr7='+cr7 +'&cr8='+cr8 +'&ref='+ref;


        //alert (dataString);return false;
        $.ajax({
        type: "POST",
        url: "bin/process.php",
        data: dataString,
        cache:false,
        datatype: 'json',               
        success: function(data) {

        $('#display').html("<h2>Data submitted!</h2>")
        .append("<p>Wait........</p>")
        .hide()
        .fadeIn(1500, function() {
        $('#display').append("<img id='checkmark' src='images/check-black.jpg' />");
        $('#display').html("<h3>Being Processed...</h3>")
        .fadeIn(1500, function() {
        $('#display').append("Saved <img id='checkmark' src='images/check-black.jpg' />")
        $('#thisfrm').get(0).reset();
        $("#indate").val(indate)






        });

        });
        }
        });


        return false;   

My PHP echos

                echo 'This is processing file.\n';


            $doctype = $_REQUEST['doctype'];
            $paytype = $_REQUEST['paytype'];
            $docno = $_REQUEST['docno'];
            $bookno = $_REQUEST['bookno'];
            $prname = $_REQUEST['prname'];
            $pename = $_REQUEST['pename'];
            $paydate = $_REQUEST['paydate'];
            $inpdate = $_REQUEST['inpdate'];
            $ref = $_REQUEST['ref'];


            echo $doctype."<br>";
            echo $paytype."<br>";
            ....
            ... and so on

but it is not shown anywahere on the webpage.

Thanks in advance for any help .

  • 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-24T17:28:19+00:00Added an answer on May 24, 2026 at 5:28 pm

    The data that is output by PHP during an AJAX request will be in the data variable of your success callback function. If you want to append the data onto your page, you’ll need to do so in your success function.

    $.ajax({
        type: "POST",
        url: "bin/process.php",
        data: dataString,
        cache:false,          
        success: function(data) {
            // the data variable contains all PHP output during this request
            $('#display').html(data);
        }
    });
    

    Also note, your script currently specified that it is a JSON request – that jQuery ought to treat the output as JSON data. However, you are outputting text/html data in your PHP snippet. Either a) append your html into one variable, then call print json_encode($mydata);, OR b) remove the datatype property from the request. jQuery will “auto-detect” the response type. The above example is assuming you do NOT change the PHP code, below is details on how to correctly use JSON instead (change to PHP required).

    To do the JSON method, instead of using echo, use a variable:

    $html = '';
    $html .= 'Doctype: '.$doctype;
    $html .= 'Something elese: '.$something_else;
    // etc...
    die(json_encode(array('html'=>$html)));
    

    Then your jQuery ajax function looks like this:

    $.ajax({
        type: "POST",
        url: "bin/process.php",
        data: dataString,
        cache:false,
        datatype: 'json',           
        success: function(data) {
            $('#display').html(data.html);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My script runs fine when I execute it from outside the application (terminal), but
On my local machine the script runs fine but in the cloud it 500
I have a script in kohana which runs fine on php 5.2.11. I took
I've got a basic php script that runs perfect in a browser. I want
i have a php script which runs fine when executed by SSHing into my
The script runs fine when stdout/stderr are not redirected. When I add both stderr
I have created a Greasemonkey script that runs fine in the firebug editor, with
I have a cron job to run a Ruby script, which runs fine on
I have a php script that is run once a minute. The script runs
Hi guys I have a weird question, I have a cli php script runs

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.