[Smarty] Rendering a page in steps...

Associate
Joined
21 May 2003
Posts
1,365
I have an ordering script which has to wait for card verification before showing the confirmation details. I want to display an animated "processing" gif while the user waits for this to happen (sometimes upto 2 minutes).

I have created a "processing" div that I can hide with javascript upon the page completing loading that contains the gif and some text. I call the template->display() function before I call the card verification code so that this div (and the header etc) will display immediately.

Once the card has been verified, I then want to include and display either a success message with the confirmation details or a declined message, which I store in seperate templates.

How do I get this second part to display?

This doesn't seem to work:
Code:
$tpl->display('step4.tpl');
flush();

// do transaction request
// if card declined
echo $tpl->fetch('step4declined.tpl');
The above will display the animated gif and then hide it after the transaction returns but won't display the declined message...
 
Still got a problem - IE will only partially load everything that gets sent to it by the first display call - it won't show the div with the animation in.

Is there any way to force IE to display everything it has received?
 
Back
Top Bottom