Is there a way to export the results of a php file to an html file,save it and then email it?
ty for the help
Is there a way to export the results of a php file to an html file,save it and then email it?
ty for the help
i would like to know what you mean by writing
"... export the results of a php file ..."
It would be usefull if you give us an example , so my question gets answered and you probably get more effective help.
so far
ali
ok....
when a php file is executed on the server, I am getting a result to my browser.
I found a way of capturing all this page to am html file but how can I send this file by email?
I have read I can't remember how many articles but I can't get it, I don't know what I am doing wrong.
thanks a lot
You can use "buffered output" with "file handles" to save all text output produced by your script.
Look at the php manual (e.g. @ php.net) for detailed information to these topics.
If you don't find what you expect there, just send me further q.
Good Luck
jo
I haven't done this yet, but I would try to read in the written file again into $text and send it with the standard php function for sending mail.
jo
If you are a Linux user you can use the good old Lynx browser to activate the php page in your web server and save the resulting html to a file.
Do like this on the command promt or in a shell script:
lynx -source
"http://localhost/~user/thepage.php" >> "/home/~user/theoutput.html"
(I use this to perform pure server side tasks written in php from shell scripts. The html output is then a log file only i my situation)
In IE, go to :
File -> Save As -> Save
This will create a saved HTML page on your hard drive. Attach the saved page, and the resulting nessary images to an e-mail, and you're all set.
If you want to do it in php, for some reason.
<?php
function saveMe($pageContent){
$filePath = "Any Dir Path You Want";
if($temp = fopen($filePath, "w")){
fwrite($temp, $pageContent);
fclose($temp);
return true;
}
else{
return false;
}
}
?>
Peace,
-Alex