(résolu) phpbb et variables globales

WRInaute occasionnel
J'interface phpbb avec mes scripts et je tombe sur un problème.

les variables de mon script que je recupère dans mes fonctions via une ligne du type

Code:
global $variable;

sont vides depuis que mon script est intégré avec phpbb.

Avant j'arrivais très bien à les récupérer.

Qu'est-ce qu'il a bien pu me désactiver ?

Merci !
 
WRInaute occasionnel
trouvé :

Code:
About more complex situation using global variables..

Let's say we have two files:
a.php
<?php
    function a() {
        include("b.php");
    }
    a();
?>

b.php
<?php
    $b = "something";
    function b() {
        global $b;
        $b = "something new";
    }
    b();
    echo $b;
?>

You could expect that this script will return "something new" but no, it will return "something". To make it working properly, you must add global keyword in $b definition, in above example it will be:

global $b;
$b = "something";
 
Discussions similaires
Haut