I isn't sure I know what you mean.
But you can make the script making a action without reloading your site. (You can etc. reload a "hidden" frame, so the user can see the reload).
You have to get into a action to the webserver, because PHP is a serverside language, and not like JavaScript a client language, there the actions is done at the client, and not at the server.
Hope you understand, else please reply :o)