Forums
This topic is locked
Redirecting HTML output to File
Posted 27 Mar 2002 05:43:07
1
has voted
27 Mar 2002 05:43:07 Paul Padilla posted:
How would one go about redirecting the result of an HTML page to a file in the webserver instead of the client's browser? I am trying to parse out information from an HTML result page using PHP but don't know which PHP syntax to use to redirect the HTML result into a file.Cheers,
Paul
Replies
Replied 27 Mar 2002 23:02:48
27 Mar 2002 23:02:48 Michael O'Neill replied:
Wouldn't mind an answer to this one myself!!
If I find anything I'll post it.
Mike.
If I find anything I'll post it.
Mike.
Replied 27 Mar 2002 23:07:18
27 Mar 2002 23:07:18 chief monkey replied:
PHP has a full range of functions to achieve this start here
www.php.net/fopen()
George
Everybody has got to be somewhere
Replied 31 Mar 2002 14:11:23
31 Mar 2002 14:11:23 Bruno Mairlot replied:
You can eventually try to use the prefix when using fopen.
this would requires something like :
<pre id=code><font face=courier size=2 id=code>
$str
$fh = fopen("....","r"); // The input
$fo = fopen("filename","w" // The output
while(!feof($fh)){
fwrite($fo,fread($fh,1024));
}
</font id=code></pre id=code>
But, could you describe a little further what exactly you would like to do ?
Bruno
--- Better to die trying, than never try at all ---
this would requires something like :
<pre id=code><font face=courier size=2 id=code>
$str
$fh = fopen("....","r"); // The input
$fo = fopen("filename","w" // The output
while(!feof($fh)){
fwrite($fo,fread($fh,1024));
}
</font id=code></pre id=code>
But, could you describe a little further what exactly you would like to do ?
Bruno
--- Better to die trying, than never try at all ---
Replied 23 Apr 2002 08:23:42
23 Apr 2002 08:23:42 Michael O'Neill replied:
I don't know what Paul had in mind but I would like to be able to create and email a html invoice to a customer. My invoices are created from a MySql database when a customer makes a purchase.
Thanks
Mike.
Thanks
Mike.