hello there, I am wondering how to execute a php code in part of the page without reloading the whole page?
The simple answer is you can't as PHP does it's stuff before the output to the browser occurs. Once that's done the user is presented with the HTML code to build the page and never knows that PHP had anything to do with it. The only way to update stuff after the page has loaded is to investigate AJAX which uses Javascript to make so called async calls back to the server. It can look a little daunting, but there's loads of tutorials out there for the basics and the Javascript forum on here should be handy too. Just remember that since it's Javascript, search engines can't see it. Trev Edit: What he said....forgot to hit submit.
There are also lots of javascript libraries that could make this task much easier like jQuery or Prototype. They have great AJAX support and also simplifies DOM manipulation.
Oops! Right but its not mostly used since it displays a scroll bar and makes ugly as you said when page i too long! Also there are others like Flash, Flex, Java, SVG and Ruby on Rails etc.,
PHP is a server side language that must be compiled at the server, before any HTML is sent to the browser. To do what you are looking to do required JQuery. It is very simple and easy to do and I use it on a lot of my scripts at www.scripteen.com You need to include the JQuery source file in the head of your document and then use the following code: