Re: Re: Eval a file, and it gives parse error because it uses a preg_match statement with \$
| From: | Justin Patrin | Date: | Fri, 06 Aug 2004 15:37:07 +0000 |
| Subject: | Re: Re: Eval a file, and it gives parse error because it uses a preg_match statement with \$ | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192999@lists.php.net to get a copy of this message | ||
On Fri, 6 Aug 2004 11:20:38 -0700, Josh Acecool M
<webmaster@acecoolco.com> wrote:
> I dont have magic_quotes etc on, so when I use file_get_contents the EXACT,
> yes, EXACT file gets placed.
1) This is not a response to the e-mail you're responding to. I see
nothing about magic quotes in Curt's e-mail.
2) You're saying the same things over and over.
Stop wasting our time on this if you won't use our help. Once more:
1) we know that include won't work for this as you finallty gave us
some pseudo-code
2) the error is in your preg_replace call, *not*, I repeat, *NOT* in
the file_get_contents'd file. This thread has nothing to do with
file-get_contents vs. include, but since you gave such a bad
description of your problem, that's what we ended up talking about.
You need to read this:
http://www.catb.org/~esr/faqs/smart-questions.html
> "Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message
> news:20040806032539.GX6522@bagend.shire...
> > * Thus wrote Josh Acecool M:
> > > You dont understan..
> >
> > Not anymore. Honestly I haven't had a clue what was going on till
> > Justin pushed you into the right direction.
> >
> >
> > >
> > > Say the template is:
> > >
> > > Blah
> > > {CONTENT}
> > > adasdasd
> > >
> > > I want to preg_replace("/{CONTENT}/", include("blah.php"),
> > > $text);
> >
> > the example I quoted didn't use include(). Dont use include, use
> > file_get_contents().
> >
> > >
> > >
> > > "Curt Zirzow" <php-general@zirzow.dyndns.org> wrote in message
> > > news:20040806005318.GU6522@bagend.shire...
> > > > * Thus wrote Josh Acecool M:
> > > > >
> > > > > but, I am doing this.
> > > > >
> > > > > $text = file_get_contents('templateFile.php');
> > > > > $text = preg_replace('/something/',
> file_get_contents("something.php"),
> > > > > $text);
> > > > > eval("?>" . $text . "<?")
> > > >
> > > > This is rather an odd thing to do, kinda like taking an html
> > > > document converting it to xml, add an element, then turning it back
> > > > to html.
> > > >
> > > > To get around your \$ problem..
> > > > see http://php.net/preg_quote
> >
> > Curt
> > --
> > First, let me assure you that this is not one of those shady pyramid
> schemes
> > you've been hearing about. No, sir. Our model is the trapezoid!
>
--
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder
paperCrane --Justin Patrin--