jeddi
09-02-2009, 07:11 PM
Hi,
I am trying to make my paypal form work and
it looks like I need to create a "paper trail" of the
script progress.
Normally I would do it with echoes so that I can
see where it gets to on the screen, but when doing a live payment,
I don't get the screen echos because it is the paypal server
that is running my script.
So what I need to do is open a file and store my echos statements in it.
So open a file do I just use:
$log_file = $_SERVER['DOCUMENT_ROOT']."/log.txt";
$handle = fopen("$log_file", "w");
and then write something
$content = "The script got here";
fwrite($handle, $content);
If the script fails somewhere, then I may not
be able to close the file with the fclose($handle);
statement. - Is that a problem ?
Is there anything else that I need to do ?
Thanks for any guidance.
I am trying to make my paypal form work and
it looks like I need to create a "paper trail" of the
script progress.
Normally I would do it with echoes so that I can
see where it gets to on the screen, but when doing a live payment,
I don't get the screen echos because it is the paypal server
that is running my script.
So what I need to do is open a file and store my echos statements in it.
So open a file do I just use:
$log_file = $_SERVER['DOCUMENT_ROOT']."/log.txt";
$handle = fopen("$log_file", "w");
and then write something
$content = "The script got here";
fwrite($handle, $content);
If the script fails somewhere, then I may not
be able to close the file with the fclose($handle);
statement. - Is that a problem ?
Is there anything else that I need to do ?
Thanks for any guidance.