Re: Re: Eval a file, and it gives parse error because it uses a preg_match statement with \$
| From: | Josh Acecool M | Date: | Fri, 06 Aug 2004 04:42:58 +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 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192925@lists.php.net to get a copy of this message | ||
5.0.0
Include WORKS, but using INCLUDE with PREG_REPLACE does NOT work, the text
you want to replace gets deleted and the INCLUDE includes on the top of the
page...
"Justin Patrin" <papercrane@gmail.com> wrote in message
news:432beae04080510074de3f47d@mail.gmail.com...
> On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M
> <webmaster@acecoolco.com> wrote:
> > The files that are evaled work perfectly without being evaled.
> >
> > I dont think eval was meant for large files etc.
> >
> > Whats on that like: a preg_match that looks for \$variable = something;
> >
> > and thats the like it messes up on.
> >
> > Also, if the file which is evaled includes another file, the variables
from
> > the included file wont get parsed or anything, and the variables set to
it
> > by the first file, or the class dont work at all.
> >
>
> What version of PHP are you using?
>
> Are you doing anything to the string before eval-ing it? You say that
> if you just include() is, it works fine. *Why* not just include it,
> then?
>
> > "John Holmes" <holmes072000@charter.net> wrote in message
> > news:4111626E.5090202@charter.net...
> >
> >
> > > Josh Acecool M wrote:
> > > >>> var $The_Template_Sys;
> > > >>>
> > > >>>$this -> The_Template_Sys =
file_get_contents("$The_Template_File");
> > > >>>
> > > >>>$this -> Sub_Template = TRUE;
> > > > Any ideas?
> > >
> > > I have an idea I said in a previous email!
> > >
> > > >>you say you're getting a parse error. How could anyone possibly help
you
> > > >>troubleshoot that parse error unless they had an example of what was
in
> > > >>the file being eval()'d??
> > >
> > > What is actually in the file that's failing the eval()??!?!?! What
line
> > > of the file is failing? What is on that line? What's on the couple of
> > > lines before it? What's on the couple of lines after that line that's
> > > failing? What does the line with the eval() call look like? Are you
> > > doing anything else with $this->The_Template_Sys before it's
> > eval()'d??????
> > >
> > > --
> > >
> > > John Holmes
> > >
> > > php|architect - The magazine for PHP professionals -
> > http://www.phparch.com
> >
>
> --
> DB_DataObject_FormBuilder - The database at your fingertips
> http://pear.php.net/package/DB_DataObject_FormBuilder
>
> paperCrane --Justin Patrin--