hireaprogrammer -1 Junior Poster in Training

Hello,
Just need quick help in PHP + SQL SERVER 2005 DB CONNECTION ...i having problem while connection SQL SERVER 2005 WITH PHP APPLICATION WHICH WORKING PERFECTLY IN LOCALHOST AT MY PC BUT IT NOW NOT WORKING ON THE SERVER SO DON'T KNOW WHATS WRONG ? I THINK ANY SERVER FUNCTIONALITY REQUIRED OR ANY OTHER THING ?

PLEASE TELL HELP ME OUT

click here to visit error/server page
configuration.php

<?php

//echo getcwd(); exit;
//**********************for local to live change mainroot,sitepath and database detail
// define our webserver variables
// FS = Filesystem (physical)
// WS = Webserver (virtual)
   // define('DIR_FS_DOCUMENT_ROOT', 'C:\wamp\www\drivernew'); 
  define('DIR_FS_DOCUMENT_ROOT', 'c:\domains\rockersinfo.com\wwwroot\update\driver'); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs)
  define('DIR_FS_ROOT', DIR_FS_DOCUMENT_ROOT . '/');
  define('DIR_WS_ROOT', DIR_FS_ROOT);
  
  // define our database connection
  /*define('DB_SERVER', 'SYSTEM');
  define('DB_SERVER_USERNAME', '');
  define('DB_SERVER_PASSWORD', '');
  define('DB_DATABASE', 'driver');*/
  
	   // define our database connection
	  //define('DB_SERVER', '64.50.162.71');
	  define('DB_SERVER', 'localhost');
	  define('DB_SERVER_USERNAME', 'sunil');
	  define('DB_SERVER_PASSWORD', 's@123');
	  define('DB_DATABASE', 'TMX');
	  
	  //default constant
	  define('DIR_WS_INCLUDES', DIR_WS_ROOT . 'includes/');
	  define('DIR_WS_LANGUAGE', DIR_WS_ROOT . 'language/');
	  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
	  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
	  define('DIR_WS_SMTPMAIL', DIR_WS_INCLUDES . 'smtpmail/');
	  define('SESSION_PREFIX', 'driver_'); 
		
    //Include default files
        require_once DIR_WS_INCLUDES . "database_tables.php";
        require_once DIR_WS_FUNCTIONS . "database.php";
        require_once DIR_WS_FUNCTIONS . "general.php";
        require_once DIR_WS_CLASSES . "class_session.php";//class file for session
        //initialize session object
        $session = new session;
        //call database connection function
        DB_connect() or die;
        //call clean function for clean posted and requested data
        cleandata();

        //define all default value from general settings table
        //if(!SITEPATH)
        //{
            
        //}
        //$setts = DB_get_next(DB_execute_query("SELECT * FROM " . TABLE_ADMIN_GENERAL_SETTINGS . " LIMIT 1"));
           // define("SITEPATH","http://localhost/drivernew/");
		    define("SITEPATH","http://update.rockersinfo.com/driver/");
            define("SITETITLE","Driver Management");
            define("SITELANG", "english");   
            define("DATEFORMAT", "d/m/Y");  
            
            
        if (!$session->is_set("site_lang"))
        {
            $session->set("site_lang", SITELANG);
        }
        if($session->value("site_lang")=="hebrew")
        {
        define("IMAGE_PATH",SITEPATH."/images/hebrew");
        define("CSS_PATH",SITEPATH."/css/style.css");
        define("CSS_PATH_FANCYBOX",SITEPATH."/jquery.fancybox/jquery.fancybox.hebrew.css");
        define("CONTENTTYPE_HTML", '<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" lang="he">');
        define("CONTENTTYPE", "text/html; charset=utf-8");
        define("CONTRL_DIR", 'dir="rtl"');
        header('Content-Type: text/html; charset=utf-8');
        }
        else
        {
        define("IMAGE_PATH",SITEPATH."/images");
        define("CSS_PATH",SITEPATH."/css/style.css");
        define("CSS_PATH_FANCYBOX",SITEPATH."/jquery.fancybox/jquery.fancybox.english.css");
        define("CONTENTTYPE_HTML", '<html xmlns="http://www.w3.org/1999/xhtml">');
        define("CONTENTTYPE", "text/html; charset=utf-8");
        define("CONTRL_DIR", 'dir="ltr"');  
        }
        //css and javascript path
        define("JSCRIPT_PATH",SITEPATH."/js");
        define("CSS_COMMON_PATH",SITEPATH."/css");
        define("UPLOAD_IMAGES",DIR_WS_ROOT ."upload/");
        //files fo language tag
         require_once DIR_WS_LANGUAGE .$session->value("site_lang") . "/global.lang.php";
        require_once DIR_WS_LANGUAGE .$session->value("site_lang") . "/site.lang.php";  
        //SetCurrentUser(23);


?>

database.php

<?php
function DB_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    $$link = mssql_connect($server, $username, $password); //CLIENT_MULTI_STATEMENTS
    if ($$link) 
    {
    	mssql_select_db($database);
    	//DB_execute_query("set names utf8");
    }
	else
	{
	/*echo "<script>parent.document.location.href='error.php?err=database error'</script>";*/
	}
    return $$link;
}

function DB_close($link = 'db_link') {
    global $$link;

    return mssql_close($$link);
}

function DB_error($query, $errno, $error) { 
   // die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[STOP]</font></small><br><br></b></font>');
	/*echo "<script>parent.document.location.href='error.php?err=".$error."'</script>";*/
	echo $error;
}

function DB_execute_query($query, $link = 'db_link') {
    global $$link;

   $query . "\n";
   	$result = mssql_query($query, $$link);
 if (!$result)
    	DB_error($query,'', '');

    return $result;
}

function DB_execute_none_query($table, $values, $action = 'insert', $where = '', $link = 'db_link') {
    reset($values);
    if ($action == 'insert') {
      $query = 'insert into ' . $table . ' (';
      while (list($columns, ) = each($values)) {
        $query .= $columns . ', ';
      }
      $query = substr($query, 0, -2) . ') values (';
      reset($values);
      while (list(, $value) = each($values)) {
        switch ((string)$value) {
          case 'now()':
            $query .= 'now(), ';
            break;
          case 'null':
            $query .= 'null, ';
            break;
          default:
            $query .= '\'' . DB_input($value) . '\', ';
            break;
        }
      }
      $query = substr($query, 0, -2) . ')';
    } elseif ($action == 'update') {
      $query = 'update ' . $table . ' set ';
      while (list($columns, $value) = each($values)) {
        switch ((string)$value) {
          case 'now()':
            $query .= $columns . ' = now(), ';
            break;
          case 'null':
            $query .= $columns .= ' = null, ';
            break;
          default:
            $query .= $columns . ' = \'' . DB_input($value) . '\', ';
            break;
        }
      }
      if (empty($where))
      	$where = "1";
      $query = substr($query, 0, -2) . ' where ' . $where;
    }

    try
    {
    	DB_execute_query($query, $link);
    }
	catch (Exception $e) 
	{
		//throw $e;
		DB_error($query,'', '');
	}
}

function DB_get_next($result_set) {
    return mssql_fetch_array($result_set, MYSQL_ASSOC);
}
function DB_get_array($result_set) {
    $count = 0;
	$data = array();
	while ($row = mssql_fetch_array($result_set)) {
	$data[$count] = $row;
	$count++;
	}
	mssql_free_result($result_set);
	return $data;
}

function DB_result_num_rows($result_set) {
    return mssql_num_rows($result_set);
}

/*function DB_insert_id($link = 'db_link') {
    global $$link;

    return mssql_insert_id($$link);
}*/

function DB_input($string, $link = 'db_link') {
	global $$link;

    if (function_exists('mssql_real_escape_string')) {
      return mssql_real_escape_string($string, $$link);
    } elseif (function_exists('mssql_escape_string')) {
      return mssql_escape_string($string);
    }

    return addslashes($string);
}

function DB_prepare_input($input) {
    if (is_string($input)) {
      return trim(stripslashes($input));
    } else {
      return $input;
    }
}

function DB_delete($table, $where) 
{
	DB_execute_query("delete from $table where $where");
} 
function DB_totalrecords($table) 
{
	return DB_result_num_rows(DB_execute_query("select * from $table"));
} 

function DB_totalactiverecords($table,$delecol="") 
{
	if($delecol=="")return DB_result_num_rows(DB_execute_query("select * from $table"));
	else return DB_result_num_rows(DB_execute_query("select * from $table where $delecol"));
}   

$DB_transaction_count = 0;

function DB_init_transaction()
{
	global $DB_transaction_count;
	
	$DB_transaction_count++;
	if ($DB_transaction_count == 1)
		DB_execute_query("START TRANSACTION");
}

function DB_commit_transaction()
{
	global $DB_transaction_count;
	
	if ($DB_transaction_count == 0)
		return;
	$DB_transaction_count--;
	if ($DB_transaction_count == 0)
		DB_execute_query("COMMIT");
}

function DB_abort_transaction()
{
	global $DB_transaction_count;
	
	if ($DB_transaction_count == 0)
		return;
	$DB_transaction_count = 0;
	DB_execute_query("ROLLBACK");
}
 
class WhereCondition
{
	private $field_name;
	private $operator;
	private $value;
	
	function __construct($field_name, $operator, $value)
	{
		$operators = array("=", "<", ">", "<=", ">=", "like", "in");
		if (array_search($operator, $operators) === FALSE)
			throw new Exception ("Illegal Operator");
		$this->field_name = $field_name;
		$this->operator = $operator;
		$this->value = $value;	
	}
	
	function FieldName()
	{
		return $this->field_name;
	}
	
	function GenerateCondition($type="regular")
	{
		$val = $this->value;
		if ($type == "date")
			$val = substr($this->value, 6, 4) . "-" . substr($this->value, 3, 2) . "-" . substr($this->value, 0, 2);
		$cond = $this->field_name . " " . strtoupper($this->operator) . " ";
		if ($this->operator == "like")
			$cond .= "'%%" . $this->value . "%%'";
		else if ($this->operator == "in")
			$cond .= "(" . $this->value . ")";
		else
			$cond .= "'" . $this->value . "'";
		return $cond;
	}
}
?>