IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Call to undefined function d'une fonction définie dans le fichier


Sujet :

Langage PHP

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 41
    Points : 34
    Points
    34
    Par défaut Call to undefined function d'une fonction définie dans le fichier
    Bonjour,

    J'ai un souci, je possède une fonction Lang() que je définie et appel dans le même fichier php.

    Le problème c'est lors de l'appel de celle-ci j'ai un Call to undefined function Lang().

    Or sur ma plateforme de prod qui a une version php 5.2.10 je n'ai pas ce soucis et sur ma plateforme de dev qui a une version php 5.3.3 je rencontre ce problème.

    De plus, le fichier php concerné est composé de plusieurs blocks php entrecoupés d'html.

    Ceci pourrait-il venir de la version de php ? Avez-vous déjà eu ce cas?

    Merci d'avance pour votre réponse.

  2. #2
    Membre éprouvé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2009
    Messages
    736
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : Maroc

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2009
    Messages : 736
    Points : 1 101
    Points
    1 101
    Par défaut
    Si tu peux affiché ton code

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Mai 2010
    Messages
    41
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 41
    Points : 34
    Points
    34
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    <?php
     
    /*
     * JAWStats 0.7 Web Statistics
     *
     * Copyright (c) 2009 Jon Combe (jawstats.com)
     *
     * Permission is hereby granted, free of charge, to any person
     * obtaining a copy of this software and associated documentation
     * files (the "Software"), to deal in the Software without
     * restriction, including without limitation the rights to use,
     * copy, modify, merge, publish, distribute, sublicense, and/or sell
     * copies of the Software, and to permit persons to whom the
     * Software is furnished to do so, subject to the following
     * conditions:
     *
     * The above copyright notice and this permission notice shall be
     * included in all copies or substantial portions of the Software.
     *
     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
     * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
     * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
     * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
     * OTHER DEALINGS IN THE SOFTWARE.
     */
     
      header('Content-Type: text/html; charset="utf-8"', true);
      //error_reporting(0);
      set_error_handler("ErrorHandler");
     
      // javascript caching
      $gc_sJavascriptVersion = "200901251254";
      $g_aTranslation = array();
      $g_aCurrentTranslation = array();
     
    	// includes
    	require_once "clsAWStats.php";
      require_once "languages/translations.php";
      require_once "config.php";
      ValidateConfig();
     
      // select configuraton and translations
      $g_sConfig = GetConfig();
      $g_aConfig = $aConfig[$g_sConfig];
      $sLanguageCode = SetTranslation();
     
      // external include files
      if ((isset($g_aConfig["includes"]) == true) && (strlen($g_aConfig["includes"]) > 0)) {
        $aIncludes = explode(",", $g_aConfig["includes"]);
        foreach ($aIncludes as $sInclude) {
          include $sInclude;
        }
      }
     
      // get date range and valid log file
      $g_dtStatsMonth = ValidateDate($_GET["year"], $_GET["month"]);
      $g_aLogFiles = GetLogList($g_sConfig, $g_aConfig["statspath"]);
      $g_iThisLog = -1;
      for ($iIndex = 0; $iIndex < count($g_aLogFiles); $iIndex++) {
        if (($g_dtStatsMonth == $g_aLogFiles[$iIndex][0]) && ($g_aLogFiles[$iIndex][1] == true)) {
          $g_iThisLog = $iIndex;
          break;
        }
      }
      if ($g_iThisLog < 0) {
        if (count($g_aLogFiles) > 0) {
          $g_iThisLog = 0;
        } else {
          Error("NoLogsFound");
        }
      }
     
      // validate current view
      if (ValidateView($_GET["view"]) == true) {
        $sCurrentView = $_GET["view"];
      } else {
        $sCurrentView = $sConfigDefaultView;
      }
     
      // create class
      $clsAWStats = new clsAWStats($g_sConfig,
                                   $g_aConfig["statspath"],
                                   date("Y", $g_aLogFiles[$g_iThisLog][0]),
                                   date("n", $g_aLogFiles[$g_iThisLog][0]));
      if ($clsAWStats->bLoaded != true) {
        Error("CannotOpenLog");
      }
     
      // days in month
      if (($clsAWStats->iYear == date("Y")) && ($clsAWStats->iMonth == date("n"))) {
        $iDaysInMonth = abs(date("s", $clsAWStats->dtLastUpdate));
        $iDaysInMonth += (abs(date("i", $clsAWStats->dtLastUpdate)) * 60);
        $iDaysInMonth += (abs(date("H", $clsAWStats->dtLastUpdate)) * 60 * 60);
        $iDaysInMonth = abs(date("j", $clsAWStats->dtLastUpdate) - 1) + ($iDaysInMonth / (60 * 60 * 24));
      } else {
        $iDaysInMonth = date("d", mktime (0, 0, 0, date("n", $clsAWStats->dtLastUpdate), 0, date("Y", $clsAWStats->dtLastUpdate)));
      }
     
      // start of the month
      $dtStartOfMonth = mktime(0, 0, 0, $clsAWStats->iMonth, 1, $clsAWStats->iYear);
      $iDailyVisitAvg = ($clsAWStats->iTotalVisits / $iDaysInMonth);
      $iDailyUniqueAvg = ($clsAWStats->iTotalUnique / $iDaysInMonth);
     
    ?>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
      <title><?php echo str_replace("[SITE]", GetSiteName(), str_replace("[MONTH]", Lang(date("F", $g_aLogFiles[$g_iThisLog][0])), str_replace("[YEAR]", date("Y", $g_aLogFiles[$g_iThisLog][0]), Lang("Statistics for [SITE] in [MONTH] [YEAR]")))) ?></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <link rel="stylesheet" href="themes/<?php echo $g_aConfig["theme"] ?>/style.css" type="text/css" />
      <script type="text/javascript" src="js/packed.js?<?php echo $gc_sJavascriptVersion ?>"></script>
     
      <!--
      <script type="text/javascript" src="js/jquery.js"></script>
      <script type="text/javascript" src="js/jquery.tablesorter.js"></script>
      <script type="text/javascript" src="js/swfobject.js"></script>
      -->
     
      <script type="text/javascript" src="js/constants.js?<?php echo $gc_sJavascriptVersion ?>"></script>
      <script type="text/javascript" src="js/jawstats.js?<?php echo $gc_sJavascriptVersion ?>"></script>
      <script type="text/javascript">
        var g_sConfig = "<?php echo $g_sConfig ?>";
        var g_iYear = <?php echo date("Y", $g_aLogFiles[$g_iThisLog][0]) ?>;
        var g_iMonth = <?php echo date("n", $g_aLogFiles[$g_iThisLog][0]) ?>;
        var g_sCurrentView = "<?php echo $sCurrentView ?>";
        var g_dtLastUpdate = <?php echo $clsAWStats->dtLastUpdate ?>;
        var g_iFadeSpeed = <?php echo $g_aConfig["fadespeed"] ?>;
        var g_bUseStaticXML = <?php echo BooleanToText($g_aConfig["staticxml"]) ?>;
        var g_sLanguage = "<?php echo $sLanguageCode ?>";
        var sThemeDir = "<?php echo $g_aConfig["theme"] ?>";
        var sUpdateFilename = "<?php echo $sUpdateSiteFilename ?>";
      </script>
      <script type="text/javascript" src="themes/<?php echo $g_aConfig["theme"] ?>/style.js?<?php echo $gc_sJavascriptVersion  ?>"></script>
    <?php
      if ($sLanguageCode != "en-gb") {
        echo "  <script type=\"text/javascript\" src=\"languages/" . $sLanguageCode . ".js\"></script>\n";
      }
    ?>
    <!--  <script type="text/javascript" src="http://version.jawstats.com/version.js"></script>-->
    </head>
     
    <body>
     
      <div id="tools">
    <?php
     
      echo ToolChangeMonth();
      echo ToolChangeSite();
      echo ToolUpdateSite();
      echo ToolChangeLanguage();
     
    ?>
      </div>
     
      <div id="toolmenu">
        <div class="container">
    <?php
     
      // change month
      echo "<span>";
      if ($g_iThisLog < (count($g_aLogFiles) - 1)) {
        echo "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/first.gif\" onmouseover=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/first_on.gif'\" onmouseout=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/first.gif'\" class=\"changemonth\" onclick=\"ChangeMonth(" . date("Y,n", $g_aLogFiles[count($g_aLogFiles) - 1][0]) . ")\" />" .
             "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/prev.gif\" onmouseover=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/prev_on.gif'\" onmouseout=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/prev.gif'\" class=\"changemonth\" onclick=\"ChangeMonth(" . date("Y,n", $g_aLogFiles[$g_iThisLog + 1][0]) . ")\" />";
      } else {
        echo "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/first_off.gif\" class=\"changemonthOff\" />" .
             "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/prev_off.gif\" class=\"changemonthOff\" />";
      }
      echo "<span onclick=\"ShowTools('toolMonth');\">" . Lang("Change Month") . "</span>";
      if ($g_iThisLog > 0) {
        echo "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/next.gif\" onmouseover=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/next_on.gif'\" onmouseout=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/next.gif'\" class=\"changemonth\" onclick=\"ChangeMonth(" . date("Y,n", $g_aLogFiles[$g_iThisLog - 1][0]) . ")\" />" .
             "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/last.gif\" onmouseover=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/last_on.gif'\" onmouseout=\"this.src='themes/" . $g_aConfig["theme"] . "/changemonth/last.gif'\" class=\"changemonth\" onclick=\"ChangeMonth(" . date("Y,n", $g_aLogFiles[0][0]) . ")\" /> ";
      } else {
        echo "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/next_off.gif\" class=\"changemonthOff\" />" .
             "<img src=\"themes/" . $g_aConfig["theme"] . "/changemonth/last_off.gif\" class=\"changemonthOff\" />";
      }
      echo "</span>\n";
     
      // change site (if available)
      if (($bConfigChangeSites == true) && (count($aConfig) > 1)) {
        echo "<span onclick=\"ShowTools('toolSite')\">" . Lang("Change Site") . "</span>\n";
      }
     
      // update site (if available)
      if ($bConfigUpdateSites == true) {
        echo "<span onclick=\"ShowTools('toolUpdate')\">" . Lang("Update Site") . "</span>\n";
      }
     
      // change language
      echo "<span id=\"toolLanguageButton\" onclick=\"ShowTools('toolLanguage')\">" . Lang("Change Language") .
           "<img src=\"themes/" . $g_aConfig["theme"] . "/images/change_language.gif\" /></span>\n";
     
    ?>
        </div>
      </div>
     
      <div id="header">
        <div class="container">
          <?php echo DrawHeader($g_aLogFiles[$g_iThisLog][0]) ?>
     
     
          <div id="summary">
    <?php
     
      $sTemp = Lang("Last updated [DAYNAME], [DATE] [MONTH] [YEAR] at [TIME] [ELAPSEDTIME]. A total of [TOTALVISITORS] visitors ([UNIQUEVISITORS] unique) this month, an average of [DAILYAVERAGE] per day ([DAILYUNIQUE] unique).");
      $sTemp = str_replace("[DAYNAME]", "<span>" . Lang(date("l", $clsAWStats->dtLastUpdate)), $sTemp);
      $sTemp = str_replace("[YEAR]", date("Y", $clsAWStats->dtLastUpdate) . "</span>", $sTemp);
      $sTemp = str_replace("[DATE]", Lang(date("jS", $clsAWStats->dtLastUpdate)), $sTemp);
      $sTemp = str_replace("[MONTH]", Lang(date("F", $clsAWStats->dtLastUpdate)), $sTemp);
      $sTemp = str_replace("[TIME]", "<span>" . date("H:i", $clsAWStats->dtLastUpdate) . "</span>", $sTemp);
      $sTemp = str_replace("[ELAPSEDTIME]", ElapsedTime(time() - $clsAWStats->dtLastUpdate), $sTemp);
      $sTemp = str_replace("[TOTALVISITORS]", "<span>" . number_format($clsAWStats->iTotalVisits) . "</span>", $sTemp);
      $sTemp = str_replace("[UNIQUEVISITORS]", number_format($clsAWStats->iTotalUnique), $sTemp);
      $sTemp = str_replace("[DAILYAVERAGE]", "<span>" . number_format($iDailyVisitAvg, 1) . "</span>", $sTemp);
      $sTemp = str_replace("[DAILYUNIQUE]", number_format($iDailyUniqueAvg, 1), $sTemp);
      echo $sTemp;
     
    ?>
          </div>
          <div id="menu">
            <ul>
              <li id="tabthismonth"><span onclick="ChangeTab(this, 'thismonth.all')"><?php echo Lang("This Month"); ?></span></li>
              <li id="taballmonths"><span onclick="ChangeTab(this, 'allmonths.all')"><?php echo Lang("All Months"); ?></span></li>
              <li id="tabtime"><span onclick="ChangeTab(this, 'time')"><?php echo Lang("Hours"); ?></span></li>
              <li id="tabbrowser"><span onclick="ChangeTab(this, 'browser.family')"><?php echo Lang("Browsers"); ?></span></li>
              <li id="tabcountry"><span onclick="ChangeTab(this, 'country.all')"><?php echo Lang("Countries"); ?></span></li>
              <li id="tabfiletypes"><span onclick="ChangeTab(this, 'filetypes')"><?php echo Lang("Filetypes"); ?></span></li>
              <li id="tabos"><span onclick="ChangeTab(this, 'os.family')"><?php echo Lang("Operating Systems"); ?></span></li>
              <li id="tabpages"><span onclick="ChangeTab(this, 'pages.topPages')"><?php echo Lang("Pages"); ?></span></li>
              <li id="tabpagerefs"><span onclick="ChangeTab(this, 'pagerefs.se')"><?php echo Lang("Referrers"); ?></span></li>
              <li id="tabrobots"><span onclick="ChangeTab(this, 'robots')"><?php echo Lang("Spiders"); ?></span></li>
              <li id="tabsearches"><span onclick="ChangeTab(this, 'searches.keywords')"><?php echo Lang("Searches"); ?></span></li>
              <li id="tabsession"><span onclick="ChangeTab(this, 'session')"><?php echo Lang("Sessions"); ?></span></li>
              <li id="tabstatus"><span onclick="ChangeTab(this, 'status')"><?php echo Lang("Status"); ?></span></li>
            </ul>
          </div>
          <br style="clear: both" />
          <div id="loading">&nbsp;</div>
        </div>
      </div>
      <div id="main">
        <div class="container">
          <div id="content">&nbsp;</div>
          <div id="footer">
            <?php echo DrawFooter(); ?>
            <span id="version">&nbsp;</span>
          </div>
        </div>
      </div>
    </body>
     
    </html>
     
    <?
     
      // output booleans for javascript
      function BooleanToText($bValue) {
        if ($bValue == true) {
          return "true";
        } else {
          return "false";
        }
      }
     
      // error display
      function Error($sReason, $sExtra="") {
        // echo "ERROR!<br />" . $sReason;
        switch ($sReason) {
          case "BadConfig":
            $sProblem     = str_replace("[FILENAME]", "\"config.php\"", Lang("There is an error in [FILENAME]"));
            $sResolution  = "<p>" . str_replace("[VARIABLE]", ("<i>" . $sExtra . "</i>"), Lang("The variable [VARIABLE] is missing or invalid.")) . "</p>";
            break;
          case "BadConfigNoSites":
            $sProblem     = str_replace("[FILENAME]", "\"config.php\"", Lang("There is an error in [FILENAME]"));
            $sResolution  = "<p>" . Lang("No individual AWStats configurations have been defined.") . "</p>";
            break;
          case "CannotLoadClass":
            $sProblem     = str_replace("[FILENAME]", "\"clsAWStats.php\"", Lang("Cannot find required file [FILENAME]"));
            $sResolution  = "<p>" . Lang("At least one file required by JAWStats has been deleted, renamed or corrupted.") . "</p>";
            break;
          case "CannotLoadConfig":
            $sProblem     = str_replace("[FILENAME]", "\"config.php\"", Lang("Cannot find required file [FILENAME]"));
            $sResolution = "<p>" . str_replace("[CONFIGDIST]", "<i>config.dist.php</i>", str_replace("[CONFIG]", "<i>config.php</i>", Lang("JAWStats cannot find it's configuration file, [CONFIG]. Did you successfully copy and rename the [CONFIGDIST] file?"))) . "</p>";
            break;
          case "CannotLoadLanguage":
            $sProblem     = str_replace("[FILENAME]", "\"languages/translations.php\"", Lang("Cannot find required file [FILENAME]"));
            $sResolution  = "<p>" . Lang("At least one file required by JAWStats has been deleted, renamed or corrupted.") . "</p>";
            break;
          case "CannotOpenLog":
            $sStatsPath = $GLOBALS["aConfig"][$GLOBALS["g_sConfig"]]["statspath"];
            $sProblem     = Lang("JAWStats could not open an AWStats log file");
            $sResolution  = "<p>" . Lang("Is the specified AWStats log file directory correct? Does it have a trailing slash?") . "<br />" .
                            str_replace("[VARIABLE]", "<strong>\"statspath\"</strong>", str_replace("[CONFIG]", "<i>config.php</i>", Lang("The problem may be the variable [VARIABLE] in your [CONFIG] file."))) . "</p>" .
                            "<p>" . str_replace("[FOLDER]", "<strong>" . $sStatsPath . "</strong>\n", str_replace("[FILE]", "<strong>awstats" . date("Yn") . "." . $GLOBALS["g_sConfig"] . ".txt</strong>", Lang("The data file being looked for is [FILE] in folder [FOLDER]")));
            if (substr($sStatsPath, -1) != "/") {
              $sResolution  .= "<br />" . str_replace("[FOLDER]", "<strong>" . $sStatsPath . "</strong>", Lang("Try changing the folder to [FOLDER]"));
            }
            $sResolution  .= "</p>";
            break;
          case "NoLogsFound":
            $sStatsPath = $GLOBALS["aConfig"][$GLOBALS["g_sConfig"]]["statspath"];
            $sProblem     = Lang("No AWStats Log Files Found");
            $sResolution  = "<p>JAWStats cannot find any AWStats log files in the specified directory: <strong>" . $sStatsPath . "</strong><br />" .
                            "Is this the correct folder? Is your config name, <i>" . $GLOBALS["g_sConfig"] . "</i>, correct?</p>\n";
            break;
          case "Unknown":
            $sProblem     = "";
            $sResolution  = "<p>" . $sExtra . "</p>\n";
            break;
        }
        echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" " .
             "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" .
             "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n" .
             "<head>\n" .
             "<title>JAWStats</title>\n" .
             "<style type=\"text/css\">\n" .
             "html, body { background: #33332d; border: 0; color: #eee; font-family: arial, helvetica, sans-serif; font-size: 15px; margin: 20px; padding: 0; }\n" .
             "a { color: #9fb4cc; text-decoration: none; }\n" .
             "a:hover { color: #fff; text-decoration: underline; }\n" .
             "h1 { border-bottom: 1px solid #cccc9f; color: #eee; font-size: 22px; font-weight: normal; } \n" .
             "h1 span { color: #cccc9f !important; font-size: 16px; } \n" .
             "p { margin: 20px 30px; }\n" .
             "</style>\n" .
             "</head>\n<body>\n" .
             "<h1><span>" . Lang("An error has occured") . ":</span><br />" . $sProblem . "</h1>\n" . $sResolution .
             "<p>" . str_replace("[LINKSTART]", "<a href=\"http://www.jawstats.com/documentation\" target=\"_blank\">", str_replace("[LINKEND]", "</a>", Lang("Please refer to the [LINKSTART]installation instructions[LINKEND] for more information."))) . "</p>\n" .
             "</body>\n</html>";
        exit;
      }
     
      // error handler
      function ErrorHandler ($errno, $errstr, $errfile, $errline, $errcontext) {
        if (strpos($errfile, "index.php") != false) {
          switch ($errline) {
            case 39:
              Error("CannotLoadClass");
              break;
            case 40:
              Error("CannotLoadLanguage");
              break;
            case 41:
              Error("CannotLoadConfig");
              break;
            default:
              //Error("Unknown", ("Line #" . $errline . "<br />" . $errstr));
          }
        }
      }
     
      // translator
      function Lang($sString) {
        if (isset($GLOBALS["g_aCurrentTranslation"][$sString]) == true) {
          return $GLOBALS["g_aCurrentTranslation"][$sString];
        } else {
          return $sString;
        }
      }
     
    ?>

  4. #4
    Modératrice
    Avatar de Celira
    Femme Profil pro
    Développeuse PHP/Java
    Inscrit en
    Avril 2007
    Messages
    8 633
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : Développeuse PHP/Java
    Secteur : Industrie

    Informations forums :
    Inscription : Avril 2007
    Messages : 8 633
    Points : 16 372
    Points
    16 372
    Par défaut
    Tentative bête : essaye de mettre la définition de la fonction au début du script

  5. #5
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 887
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 887
    Points : 16 320
    Points
    16 320
    Par défaut
    Ou de mettre <?php à la place de <? seulement lors de la dernière ouverture des balises PHP. Peut-être que la configuration est différente sur le dev et la prod.

Discussions similaires

  1. Réponses: 1
    Dernier message: 30/05/2013, 17h16
  2. Réponses: 8
    Dernier message: 05/04/2011, 08h06
  3. Appel d'une fonction défini dans un autre fichier javascript
    Par jep33 dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 20/02/2009, 08h43
  4. Réponses: 1
    Dernier message: 08/05/2008, 08h51
  5. Réponses: 2
    Dernier message: 14/12/2006, 22h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo