[PHP] String containing PHP Code

2003-06-16 Thread Suhas Pharkute
Hello,

I have a php script which generates a string which has php code in it. I need to 
run that code.

For example:

?php

$str =  ?php echo 'Hello World!'; ?;
?


Is there any way that we can do it? I know I can do it by writing it to file but then 
it is no more secured.

Please let me know,

Thanks
Suhas
_

Suhas S Pharkute.
P O Box 8551,
Pocatello ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas
_

RE: [PHP] String containing PHP Code

2003-06-16 Thread Martin Towell
you can use exec() but be sure that the code you're executing is not
malicious first

-Original Message-
From: Suhas Pharkute [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 17 June 2003 9:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] String containing PHP Code


Hello,

I have a php script which generates a string which has php code in it. I
need to run that code.

For example:

?php

$str =  ?php echo 'Hello World!'; ?;
?


Is there any way that we can do it? I know I can do it by writing it to file
but then it is no more secured.

Please let me know,

Thanks
Suhas
_

Suhas S Pharkute.
P O Box 8551,
Pocatello ID 83209.
1.208.221.3896
http://myweb.cableone.net/psuhas
_
__ Information from NOD32 1.436 (20030612) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




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



Re: [PHP] String containing PHP Code

2003-06-16 Thread Steve Keller
At 6/16/2003 05:45 PM, Suhas Pharkute wrote:

 I have a php script which generates a string which has php code in 
it. I need to run that code.



http://www.php.net/eval

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] String containing PHP Code

2003-06-16 Thread Martin Towell
oops - yeah, not exec() as in my previous email - sorry about that :/

-Original Message-
From: Steve Keller [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 17 June 2003 10:06 AM
To: Suhas Pharkute; [EMAIL PROTECTED]
Subject: Re: [PHP] String containing PHP Code


At 6/16/2003 05:45 PM, Suhas Pharkute wrote:

  I have a php script which generates a string which has php code in 
it. I need to run that code.



http://www.php.net/eval

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__ Information from NOD32 1.436 (20030612) __

This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com




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



Re: [PHP] String containing PHP Code

2003-06-16 Thread Lars Torben Wilson
On Mon, 2003-06-16 at 16:45, Suhas Pharkute wrote:
 Hello,
 
 I have a php script which generates a string which has php code in it. I need to 
 run that code.
 
 For example:
 
 ?php
 
 $str =  ?php echo 'Hello World!'; ?;
 ?
 
 
 Is there any way that we can do it? I know I can do it by writing it to file but 
 then it is no more secured.
 
 Please let me know,
 
 Thanks
 Suhas

You want eval(). It should all be explained here:

   http://www.php.net/eval


Hope this helps,

Torben


-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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