To display a proper progress bar, you need to know how far through (percentage complete) your process is and report back this figure so that the client can update it's bar.
This can be quite complex - for example, if you are calling a database procedure that can take some time, how do you know how far the db operation is and how long it would take to complete? (it's possible, just difficult!)
In these situations, you might find it easier just to display a
'please wait' animated gif[
^]. It's a lot simplier and is a recognised way of letting the client know that the operation might take some time.