PHP within PHP...

PHP within PHP...

am 17.09.2007 20:56:00 von Mandragon03

I took over the support of a website that is set up something like
this inside one of the pages:


include_once("header.php");

//to get the content of the page they do this:
$content = mysql_query("select content etc...);

echo $content;
?>

include_once("footer.php");

I am having problems evaluating any php that is used in the mysql
content. Is there a way to get the mysql withing the mysql to run?

Thank you for your time,

Mandragon

Re: PHP within PHP...

am 17.09.2007 20:57:45 von Mandragon03

On Sep 17, 12:56 pm, Mandrago...@gmail.com wrote:
> I took over the support of a website that is set up something like
> this inside one of the pages:
>
> include_once("header.php");
>
> > //to get the content of the page they do this:
> $content = mysql_query("select content etc...);
>
> echo $content;
> ?>
>
> include_once("footer.php");
>
> I am having problems evaluating any php that is used in the mysql
> content. Is there a way to get the mysql withing the mysql to run?
>
> Thank you for your time,
>
> Mandragon

Sorry, The question should read:

"Is there a way to get the php withing the echo $htmlcontent to run?"

Re: PHP within PHP...

am 17.09.2007 20:58:52 von ragearc

Of course you are, $content is a resource. The MySQL Query resource.

try this:

$content = mysql_query('bla bla bla');
while ($row = mysql_fetch_assoc($content)) {
$result[] = $row;
}

$content = $result;

Now you can use $content ;).

Re: PHP within PHP...

am 17.09.2007 20:59:55 von ragearc

In answer to your edit...

eval($content); -> This will parse as PHP.

Re: PHP within PHP...

am 17.09.2007 21:06:12 von Mandragon03

On Sep 17, 12:59 pm, RageARC wrote:
> In answer to your edit...
>
> eval($content); -> This will parse as PHP.

On Sep 17, 12:59 pm, RageARC wrote:
> In answer to your edit...
>
> eval($content); -> This will parse as PHP.

Thank you!

It has been some time since I have done this. Thanks for the help.

Mandragon

Re: PHP within PHP...

am 17.09.2007 21:21:42 von Michael Fesser

..oO(Mandragon03@gmail.com)

>On Sep 17, 12:59 pm, RageARC wrote:
>> In answer to your edit...
>>
>> eval($content); -> This will parse as PHP.
>
>Thank you!
>
>It has been some time since I have done this. Thanks for the help.

Eval() is evil. Why does $content contain PHP code?

Micha