[PHP] database with php code

2001-12-07 Thread Sergio Mergen


Hello

 
in my database i have records that contain php code.
i want to put these content on a php file. 
Here´s the problem:  
Suppose the content returned from the Db is:
$codeFromDB = "";


if i do:
echo $codeFromDB;

i´d be writing the content to the returned html file, bu i´d like
the content to be processed by php. I suppose "echo" is not the way to do it.. 
So what can i do??

thanks for your time



Sérgio Mergen
Web developer VIAVALE Internet



Re: [PHP] database with php code

2001-12-07 Thread Sergio Mergen

thanks guys..

your suggestion worked.. but there´s a problem..
the code i´m storing on a database mixs phpcode with html, like this:



now it´s html



how can i deal with that??
one solution would be to split the string into
a php code array and a html code array, and then,
depending on the case, use echo or eval..
but that´s is too much trouble...
could it be an easier way to work these thing around??

thanks again for the replies


Sérgio Mergen


> strip the  from the strings and do
> eval();
>
> HTH
>
> Regards,
> Andrey Hristov
> - Original Message -
> From: "Sergio Mergen" <[EMAIL PROTECTED]>
> To: "php List (E-mail)" <[EMAIL PROTECTED]>
> Sent: Friday, December 07, 2001 9:39 PM
> Subject: [PHP] database with php code
>
>
>
> Hello
>
>
> in my database i have records that contain php code.
> i want to put these content on a php file.
> Here´s the problem:
> Suppose the content returned from the Db is:
> $codeFromDB = "";
>
>
> if i do:
> echo $codeFromDB;
>
> i´d be writing the content to the returned html file, bu i´d like
> the content to be processed by php. I suppose "echo" is not the way to do
it..
> So what can i do??
>
> thanks for your time
>
>
>
> Sérgio Mergen
> Web developer VIAVALE Internet
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] database with php code

2001-12-07 Thread Sergio Mergen

nice !

Sérgio Mergen


I vaguely remember there being something about this in the user notes at
http://php.net/eval

If I remember correctly, it was something along the lines of adding a ?>
to the beginning of your string, and a  -Original Message-
> From: Sergio Mergen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 07, 2001 2:08 PM
> To: Andrey Hristov
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] database with php code
>
>
> thanks guys..
>
> your suggestion worked.. but there´s a problem..
> the code i´m storing on a database mixs phpcode with html, like this:
>
> 
> 
> now it´s html
> 
> 
>
> how can i deal with that??
> one solution would be to split the string into
> a php code array and a html code array, and then,
> depending on the case, use echo or eval..
> but that´s is too much trouble...
> could it be an easier way to work these thing around??
>
> thanks again for the replies
>
>
> Sérgio Mergen
>
>
> > strip the  from the strings and do
> > eval();
> >
> > HTH
> >
> > Regards,
> > Andrey Hristov
> > - Original Message -
> > From: "Sergio Mergen" <[EMAIL PROTECTED]>
> > To: "php List (E-mail)" <[EMAIL PROTECTED]>
> > Sent: Friday, December 07, 2001 9:39 PM
> > Subject: [PHP] database with php code
> >
> >
> >
> > Hello
> >
> >
> > in my database i have records that contain php code.
> > i want to put these content on a php file.
> > Here´s the problem:
> > Suppose the content returned from the Db is:
> > $codeFromDB = "";
> >
> >
> > if i do:
> > echo $codeFromDB;
> >
> > i´d be writing the content to the returned html file, bu i´d like
> > the content to be processed by php. I suppose "echo" is not
> the way to do
> it..
> > So what can i do??
> >
> > thanks for your time
> >
> >
> >
> > Sérgio Mergen
> > Web developer VIAVALE Internet
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]