Jump to content

need help displaying the query results in the existing html page


priyankabhar

Recommended Posts

Hi All,

 

I want to display the results of PhP query into my existing html page which has a div area for the results to display. With JavaScript, we can get the div area and then insert the html into it. But I am not sure how we can do that with php. Please give my any idea/suggestions.

 

Thanks a lot.

Two of the ways to do this:

 

<div id="content">
    <?php
    //Query code
    echo $result;
    ?>
</div>

 

Second is a sort of template engine.  Some people don't agree with these, but I feel they are very useful in certain situations.  Google this if you are interested.

Thanks for replying chrisdburns. But I want to display the html page returned by server side php in the div tag of the client side html page. I get an entirely new html page from the server, but I want to display the php response in the div tag of the html page.

 

Thanks!!!

What chrisdburns posted will put the data in the client side HTML. I think you will have to be more specific if that isn't what you are trying to do. Do you mean you don't want to refresh the page? If that is the case, you should look into AJAX.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.