diar33 Posted October 27, 2006 Share Posted October 27, 2006 Hi everyone,I am having quite a bit of trouble with a small project of mine. What I am trying to do is take an existing html result page (comes from php, pulls lots of stuff from a database and requires authentication) and turn it into a file I can attach to an e-mail. I would really prefer .pdf, but .doc or .html would be fine. I got it to work with .doc using mime-types and some word xml, but it looks terrible. I also tried .html using curl to open the page and write it to a file, but I couldn't get it to pass the authentication.Any ideas how I can do this?To summarize: I just want to be able to send a member of the site a record of their information. If it would be helpful to know more about my specific problem, please let me know.Thanks in advance,Travis Quote Link to comment Share on other sites More sharing options...
ksteuber Posted October 28, 2006 Share Posted October 28, 2006 Well it seems like the html file ought to be fairly easy.I'm having a hard time understanding exactly where the information is comming from, but if I understand right, you want something like:[code]<?php$username = $_POST['username'];$userinfo1 = $_POST['userinfo1'];$userinfo2 = $_POST['userinfo2'];$html="<html><head><title></title></head><body><h1>This is Important User Information:</h1><table><tr><td>Piece of Information #1</td><td>$userinfo1</td></tr><tr><td>Piece of Information #2</td><td>$userinfo2</td></tr></table></body></html>";$handle = fopen($username.".html", "w");fwrite($handle, $html);fclose($handle);?>[/code]Is this the sort of thing you were looking for? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.