I've tried the following code, which given me exactly what I want. the page is displaying a "loading.gif" while loading the php script, and hide it when the script is finished. This is using JQuery.
//$tr_arname=$_REQUEST['arname'] -> is the variable i've got from previous PHP page.