RE: [PHP] Output data repeatedly more than once

2003-10-01 Thread esctoday.com | Wouter van Vliet
What I would advise is to capture the output of your reciept into a
variable. Assuming that you've got some function calls, maybe even Database
request mixed up with some print commands .. Or even some times where you
escape out of php (?). Something like this

?php
$RecieptID = GetRecieptID();
Print Your reciept number: .$RecieptID;
$SomeVar = Functioncall();
Print --\n;
// some garbage //
Print You owe me: .getTotalValue();
?

And you don't want to run the script multiple times. Do like this:

?php
ob_start();
$RecieptID = GetRecieptID();
print Your reciept number: .$RecieptID;
$SomeVar = Functioncall();
print --\n;
// some garbage //
print You owe me: .getTotalValue();
$Data = ob_get_clean(); // or php versions earlier than 4.3: $Data =
ob_get_contents(); ob_end_clean();

for ($i=0;$i3;$i++) print $Data;
?

Hope it helps !

Wouter
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 1:24 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Output data repeatedly more than once

On Tuesday 30 September 2003 18:59, Marek Kilimajer wrote:
 Yes, you can. But would not it be smarter to increase the number of
 copies in the print dialog?

But that would be environmentally unfriendly because it uses more paper ;-)

--
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Do you believe in intuition?
No, but I have a strange feeling that someday I will.
*/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Output data repeatedly more than once

2003-09-30 Thread Marek Kilimajer
Yes, you can. But would not it be smarter to increase the number of 
copies in the print dialog?

[EMAIL PROTECTED] wrote:

Hi all, 
   I am creating a simple receipt system whereby user will enter relevant
info   
via a text form and using echo method to output and print the receipt data. I've
used CSS as the front-end . My question is, is it possible to output the receipt
information more than once on a single page (Browser) as I would need to
print out the receipt thrice for the different department as required.

Regards, 
Irin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Output data repeatedly more than once

2003-09-30 Thread Jay Blanchard
[snip]
My question is, is it possible to output the receipt information more
than once on a single page (Browser) as I would need to print out
the receipt thrice for the different department as required.
[/snip]

wrap the output in a for loop
for($i = 0; $i  3; $i++){
output receipt
}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Output data repeatedly more than once

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 18:59, Marek Kilimajer wrote:
 Yes, you can. But would not it be smarter to increase the number of
 copies in the print dialog?

But that would be environmentally unfriendly because it uses more paper ;-)

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Do you believe in intuition?
No, but I have a strange feeling that someday I will.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php