skynix1900;11039703 wrote:in 'MainContent.php' there is hidden "<div">(#dvMainContent) that i need to change that innerhtml so as you say its only html object in php file.and i want to know how can i change that "<div>" innerhtml?
You can use javascript. This is not something that PHP can do.*
skynix1900;11039703 wrote:i want to execute php function when user click on button(without any form).
Again, you can use javascript* (AJAX). There are javascript libraries (jQuery, for example) that make using AJAX a little simpler and less painful.
AJAX won't let you "jump" back into the same script, however. It will allow you to create a new request, and whatever PHP script you run will run fresh, from the beginning. You will probably have to re-think how your scripts are arranged.
* It would seem you misunderstand how PHP works. PHP code runs First, on your server. The [font=monospace]<div>[/font] you're talking about is not an "html object in a php file": it is just "text", as far as PHP is concerned, nothing more. PHP outputs this text to the user's browser.
Later, once we get to the browser, that output text is interpreted as HTML markup (or javascript, css, etc.) and used to create the webpage. Now, there are HTML elements in the DOM, javascript runs, and so forth: but there is no such thing as "PHP."