Page 1 of 1
Output Buffering Question
Posted: Mon Jan 06, 2003 11:37 pm
by smoky989
OK, here's the deal. I have a form that when the user hits the submit button a PHP page is called displaying the variables from the form where I want them on a page. It worls fine. What I would like to do is have the html generated by that PHP page emailed to me so I can upload the file for permanent use. I asked this question before and was told it can be doen using output buffering. I've looked at a few tutorials but could not find anything to solve by problem. If anyone could explain how I could do this it would be greatly appreciated. Thanks in Advance. Dave
Posted: Tue Jan 07, 2003 5:47 am
by DaZZleD
what you need to do is to create the entire page in one variable(let's say $display) then echo it to the browser(the user sees it) and use it as body for an email that you send to yourself. the email content type must be text only.
ofc you will have to take each email and copy the text there in a new .html file that you will afterwards upload.

Posted: Tue Jan 07, 2003 8:53 am
by mydimension
you don't have to use a variable. php has a great set of functions for output buffering. take a look at the first comment here:
http://www.php.net/manual/en/function.o ... ntents.php
he gives a brief but good example of how you can wrap your code with output buffering functions and get the contents later on into a variable.