Re: Was: Putting Evaluated Contents...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,

Now, how about taking that variable and executing it? How might one do this?

For instance:

I  might have an asp page on one server(Yeah, I have to use asp on that
server) generate the results in the form of a bit of php code, and pass it
to my php script via include method for execution. When the php page gets
the results I could execute this? Would I have to put the ob_start()...
ob_get_clean();  within a function? How would I execute it?

I am thinking of this way as my php pages use a templating system, and I
would like to take the data from the asp results and shoot them into my
template object for rendering.

just expanding off the conversation.

-Brian





> Michael Stearne wrote:
> > Hi,
> >
> > I have an file that contains PHP code..variables, db, etc.  Is it
> > possible to include the evaluted contents of that file into a variable
> > in another, the calling PHP script?
> >
> > Essentailly I am looking to do something like
> >
> > include("myCode.php") -> HTML Output -> $myVariable.
> >
> > I know could do this with something like
> > $myVariable=file_get_contents("http://localhost/myCode.php";) but I am
> > not allowed to use urls in file opens.
>
> use output buffering functions:
>
> ob_start();
> include("myCode.php");
> $myVariable = ob_get_clean(); // available since 4.3.0
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux