PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > PHP within PHP...
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP within PHP...

Réponse
 
LinkBack Outils de la discussion
Vieux 17/09/2007, 19h56   #1
Mandragon03@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP within PHP...

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


include_once("header.php");

<?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

  Réponse avec citation
Vieux 17/09/2007, 19h57   #2
Mandragon03@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP within PHP...

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");
>
> <?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?"

  Réponse avec citation
Vieux 17/09/2007, 19h58   #3
RageARC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP within PHP...

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 .

  Réponse avec citation
Vieux 17/09/2007, 19h59   #4
RageARC
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP within PHP...

In answer to your edit...

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

  Réponse avec citation
Vieux 17/09/2007, 20h06   #5
Mandragon03@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP within PHP...

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


On Sep 17, 12:59 pm, RageARC <rage...@gmail.com> 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 .

Mandragon

  Réponse avec citation
Vieux 17/09/2007, 20h21   #6
Michael Fesser
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP within PHP...

..oO(Mandragon03@gmail.com)

>On Sep 17, 12:59 pm, RageARC <rage...@gmail.com> 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 .


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

Micha
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h43.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08856 seconds with 14 queries