priyankabhar Posted October 29, 2009 Share Posted October 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/179445-need-help-displaying-the-query-results-in-the-existing-html-page/ Share on other sites More sharing options...
Stooney Posted October 29, 2009 Share Posted October 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/179445-need-help-displaying-the-query-results-in-the-existing-html-page/#findComment-946793 Share on other sites More sharing options...
priyankabhar Posted October 29, 2009 Author Share Posted October 29, 2009 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!!! Link to comment https://forums.phpfreaks.com/topic/179445-need-help-displaying-the-query-results-in-the-existing-html-page/#findComment-947107 Share on other sites More sharing options...
lemmin Posted October 29, 2009 Share Posted October 29, 2009 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. Link to comment https://forums.phpfreaks.com/topic/179445-need-help-displaying-the-query-results-in-the-existing-html-page/#findComment-947303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.