Re: HTML file with variable replacement.
| From: | Jason Bell | Date: | Thu, 02 Aug 2001 18:26:22 +0000 |
| Subject: | Re: HTML file with variable replacement. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60981@lists.php.net to get a copy of this message | ||
Didn't want to if I didn't have to. :) Thanks for the link. I assumed
there was something out there for this....
"Rasmus Lerdorf" <rasmus@php.net> wrote in message
news:Pine.LNX.4.33.0108021121080.1238-100000@rasmus.php.net...
> I would seriously suggest you take a good look at Smarty at
> http://www.phpinsider.com/php/code/Smarty/
>
> Don't re-invent the wheel.
>
> -Rasmus
>
> On Thu, 2 Aug 2001, Jason Bell wrote:
>
> > Ok, I'm trying to seperate my php from my html.... the method I've been
> > trying to use is like so:
> >
> > $html = fread(fopen("htmlpage.html", "r"),
> > filesize("htmlpage.html"));
> > print $html;
> >
> >
> > This works perfectly fine, except if I want to use a variable....
> >
> > lets say that my htmlpage.html includes the following:
> >
> > <CENTER><H2>Hello! Your variable has a value of:
> > $myvar</H2></CENTER>
> >
> > and my test.php file is as follows:
> >
> > <?php
> > $myvar = "It works!";
> > $html = fread(fopen("htmlpage.html", "r"),
> > filesize("htmlpage.html"));
> > print $html;
> > ?>
> >
> > I would expect the output to be:
> >
> > Hello! Your variable has a value of: It works!
> >
> > but what I get is:
> >
> > Hello! Your variable has a value of: $myvar
> >
> >
> > any hints/tips/suggestions? Is there another way that I should be doing
> > this?
> >
> > thanks!
> >
> > Jason
> >
> >
> >
> >
> >
>