Page 1 of 1

Include php file in another file?

Posted: Sun Oct 19, 2003 11:36 am
by richie256
Hi

I have a php file who is called by an another php... the second php file contain a switch and some function. There is no problem to call the functions from the main php, but the switch at the begining of the second php don't seem to be executed while called from the main php file.... do you think include is the good way to merge text?

main php file:

Code: Select all

<?php
include("dbcontrol.php");

(...)
?>
second php file:

Code: Select all

<?php
switch ($_GET['lang']) { 
    case 'fr': 
        $language='frmsg'; 
    break;
    case 'en': 
        $language='enmsg'; 
    break; 
    default: 
        $language='enmsg'; 
}

(...)
?>

Posted: Sun Oct 19, 2003 12:14 pm
by richie256
ok I have found my error... in a function, I was trying to call a global variable without declare it before... thanks!!