Perhaps you should look into AJAX, which will allow your server to do its thing and pass the finished data back without the client leaving the page he/she was on at all
AJAX is a very broad topic and I don't have time to go into detail, but I thought I'd at least point you in the right direction