Re: HTML in PHP to a File

From: Date: Thu, 13 Jan 2005 10:15:06 +0000
Subject: Re: HTML in PHP to a File
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-25305@lists.php.net to get a copy of this message
On Wed, 12 Jan 2005 20:46:46 -0500 "MikeA" <mavila@mich.com> wrote: > I have a PHP file that outputs HTML to the Internet to a user. The > user also wants to be able to print that output to a printer. The > user wants it formatted with page breaks in the proper place and so > on. Using one PHP script to do both, short of a line to display and a > line to print, is there a way to do this easily or am I in a pond of > alligators? Most of the output is using an echo statement. I thought > of trying to take a var and set it top echo or write according to what > is needed at that time. Here is my minitest. > > <?php > echo "<P>The test is starting"; > This line sends an incomplete paragraph as part of the HTML > $echowrite = "echo "; > The variable $echowrite now contains "echo " > $echowrite."<P>This is the first line."; > The variable $echowrite now contains "echo <P>This is the first line" > echo "<P>You should have seen the first line by now."; > This line sends another incomplete paragraph as part of the HTML > ?> > > Did not work! Hey I'll try anything to get this to work! LOL > How did you want it to work? > Seriously, how can this be done? > How can what be done? My best guess is you want to echo the variable as part of the HTML page: echo $echowrite; > Thanks. > > Mike > You need to be more specific about what does happen, and what you want to happen. You appear to be just starting out in both HTML and PHP. I suggest following a few online tutorials at W3C schools. HTH Regards Michael

« previous php.windows (#25305) next »