0

i am having the code

          if (eregi($file,$_SERVER["HTTP_ACCEPT_LANGUAGE"]) && !$use_lang) $use_lang = $file;


   This line of code is giving error:-Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\spm\includes\header.php on line 15
3
Contributors
8
Replies
9
Views
4 Years
Discussion Span
Last Post by pritaeas
0

after changing with preg_match it is giving another error- preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in C:\xampp\htdocs\spm\includes\header.php on line 15

0
<?php
  //to know, where I am (just for display this in the menuebar) - easy replacement of the extension
  $show = str_replace(".php","",basename($_SERVER["SCRIPT_NAME"]));

  include_once ("conf.php");
  include ("functions.php");

  if ($_REQUEST["use_lang"]) $use_lang = $_REQUEST["use_lang"];
  if (!$pm_auth) {
    //all languages
    if ($handle = opendir('lang/')) {
      while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != ".." && is_dir("lang/$file")) {
          $languages[] = $file;
          if (eregi($file,$_SERVER["HTTP_ACCEPT_LANGUAGE"]) && !$use_lang) $use_lang = $file;
        }
      }
      closedir($handle);
    }
    if (!$use_lang) $use_lang = "en";
  }
  /*** Language File ***/
  $lang_file = "lang/$use_lang/common.lang.php";
  if (file_exists($lang_file)) {
    include($lang_file);
  } else {
    $output = error(array("Language file $lang_file not found")) . "</div></body></html>";
    exit($output);  
  }

this is the top lines of my code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.