Visualizzazione dei risultati da 1 a 3 su 3

Discussione: dirname(_FILE_)

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2009
    Messaggi
    115

    dirname(_FILE_)

    Perchè secondo voi questo avviso.

    Notice: Use of undefined constant _FILE_ - assumed '_FILE_' in C:\vhosts\tshirtshop\include\config.inc.php on line 3



    <?php
    // SITE_ROOT contains the full path to the tshirtshop folder
    define ("SITE_ROOT", dirname(dirname(_FILE_)));
    // Setting needed to configure the Smarty template engine
    define("SMARTY_DIR", SITE_ROOT."/libs/smarty/");
    define("TEMPLATE_DIR", SITE_ROOT."/templates");
    define("COMPILE_DIR", SITE_ROOT."/templates_c");
    define("CONFIG_DIR", SITE_ROOT."/configs");
    ?>

    Vi ringrazio.

  2. #2
    Utente di HTML.it L'avatar di las
    Registrato dal
    Apr 2002
    Messaggi
    1,221
    perchè _FILE_ è una costante che non è stata definita, quella che forse vuoi usare è __FILE__ con 2 _ sia prima che dopo.



    prova così:

    Codice PHP:
    <?php
    // SITE_ROOT contains the full path to the tshirtshop folder
    define ("SITE_ROOT"dirname(dirname(__FILE__)));
    // Setting needed to configure the Smarty template engine
    define("SMARTY_DIR"SITE_ROOT."/libs/smarty/");
    define("TEMPLATE_DIR"SITE_ROOT."/templates");
    define("COMPILE_DIR"SITE_ROOT."/templates_c");
    define("CONFIG_DIR"SITE_ROOT."/configs");
    ?>

  3. #3
    Utente di HTML.it
    Registrato dal
    Dec 2009
    Messaggi
    115
    Grazie. E' come dici tu!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.