CodeIgniter Forums

Full Version: include does not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi, I'm new on this forum, I write because I have a problem with the 'include' in CodeIgniter (sorry for my bad English, I'm italian =) ).

I have a menu white 5-6 items, and depending on what the user selects, I include a different page, but it dosen't't wordk.

Can you help me, please.


El Forum

Post some code to see exactly what your are doing.

El Forum

            //se non ha indicato nessuna scheda o ha indicato le aziende visualizzo esse
            if ($s == "Supervisore"){

                //se non รจ impostata nessuna tab visualizzo quella di default
                    include '';
                else if ($Us == "Aziende"){
                    echo "Scheda Supervisore - Aziende";
                else if ($Us == "Contratti"){
                    echo "Scheda Supervisore - Contratti";
                else if ($Us == "Utenti"){
                    echo "Scheda Supervisore - Utenti";
                else if ($Us == "Fatture"){
                    echo "Scheda Supervisore - Fatture";
                else if ($Us == "Opzioni"){
                    echo "Scheda Supervisore - Opzioni";

I know there are private folders, where you can not put new files, but I put this folder in the root.
where there is 'echo' there are include..

El Forum

I don't think that external includes are allowed in php. What is the full error message returned after you ran this?

El Forum

PHP Net - include

Example #3 include() through HTTP:

/* This example assumes that is configured to parse .php
* files and not .txt files. Also, 'Works' here means that the variables
* $foo and $bar are available within the included file. */

// Won't work; file.txt wasn't handled by as PHP
include '';

// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';

// Works.
include '';

So maybe if you add the http:/ it may work!


El Forum

Hi, i think you have to enable allow_url_include in your php.ini for this to work.
(Devi abilitare la direttiva allow_url_include di PHP nel file PHP.ini, anche se non credo che altervista ti permetta di farlo).

See here: