Re: [PHP] Was: Putting Evaluated Contents...

2005-02-27 Thread Marek Kilimajer
Brian A. Anderson wrote:
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.

include('http://winserver/page.asp');
will execute php code generated by asp
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Was: Putting Evaluated Contents...

2005-02-25 Thread Brian A. Anderson
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



Re: [PHP] Was: Putting Evaluated Contents...

2005-02-25 Thread Richard Lynch
Brian A. Anderson wrote:
 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?

http://php.net/eval

Just be sure a Bad Guy can't insert mean nasty things into the code you
eval()

-- 
Like Music?
http://l-i-e.com/artists.htm

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