Aller au contenu
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Insérer du PHP dans une BDD

Featured Replies

Posté(e)

Bonjour à tous, voilà mon pb :

Je suis en train de développer un site genre CMS, les pages (articles) sont stockées dans la BDD directement en html.

Pour des pages plus évoluées (php), c'est aussi du php que je met dans ma base.

Mais lors de la récupération des enregistrements, aucun pb pour les pages basiques en html, mais les pages php ne fonctionnent pas, le php apparait en clair dans le code.

Je ne sais pas d'où ça vient, donc si quelqu'un pouvait éclairer ma lanterne, ça serait cool.

Merci d'avance.

EXPLICATIONS :

En début de page, je récup mon article :

$article=@$_GET['article'];


$tab_article=array();

if(isset($article))
$tab_article=recup_article($article);
else
$tab_article=recup_article(1);

Voilà ma fonction recup_article() :

function recup_article($id_article)
{
$link=connect();


$req_article="SELECT * FROM Articles WHERE id=$id_article;";
$result_art=mysql_query($req_article);
$art=mysql_fetch_array($result_art);

$article = array();
$article['titre']=$art['titre'];
$article['texte']=$art['texte'];
$article['description']=$art['Meta_Description'];
$article['keywords']=$art['Meta_Keywords'];

mysql_close($link);

return $article;
}

Et donc dans ma page j'ai un

echo $tab_article['texte'];

C'est ce texte qui contient du php.

Posté(e)

Tu lui demandes de t afficher le code, normal qu'il te l'affiche :)

Si ton texte contient les balises <?php ?>

eval("?>" . $tab_article['texte']);

Sinon

eval($tab_article['texte']);

Archivé

Ce sujet est désormais archivé et ne peut plus recevoir de nouvelles réponses.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.