if(!session_start()) session_start();
#######ãÚáæãÇÊ ÞÇÚÏÉ ÇáÈíÇäÇÊ#######
$dbserver = "localhost";
$dbname = "kmbroker_khaled";
$dbuser = "kmbroker_belal";
$dbpass = "belal123456";
####### DB Connecttion ########
$conn_DBC = mysql_connect("$dbserver", "$dbuser", "$dbpass") or die("Can't Connect to Database.");
if (!$conn_DBC) {
echo "Can't Conneting to Database.";
exit();
}
$conn_DBS = mysql_select_db("$dbname")or die("Can't Connect to Database..");
if (!$conn_DBS) {
echo "Can't Connect to Database.";
exit();
}
mysql_set_charset('latin1',$conn_DBC);
//######################## COUNTER #################################
if(!isset($_SESSION['admin_loggedin'])){
if($_SESSION['counted'] != 1){
$today = mktime(0,0,0,date("m",time()),date("d",time()),date("Y",time()));
$qq = mysql_query("select * from counter where cdate=".$today);
if(mysql_num_rows($qq) > 0){
mysql_query("update counter set visits=visits+1 where cdate=".$today);
$_SESSION['counted'] = 1;
}else{
mysql_query("insert into counter(cdate,visits) values ('".$today."','1')");
$_SESSION['counted'] = 1;
}
}
}
//###################################################################
//$site_dir = realpath(dirname(__FILE__) . '\\') . '\\' ;
$site_dir = "/home/kmbroker/public_html/";
$site_url = "https://www.kmbroker.com/";
$mylangs = array(
2 => "english.php",
1 => "arabic.php"
);
if(isset($HTTP_COOKIE_VARS['kmbroker_lang'])){
$_SESSION['lang'] = $HTTP_COOKIE_VARS['kmbroker_lang'];
$cLang = $HTTP_COOKIE_VARS['kmbroker_lang'];
}
if(!isset($_SESSION['lang']) || $_SESSION['lang']=="2"){
$cLang = 2;
global $mylangs;
$lang_dir = $site_dir."langs/".$mylangs[$cLang];
$_SESSION['lang']= "2";
}else{
$cLang = $_SESSION['lang'];
global $mylangs;
$lang_dir = $site_dir."langs/".$mylangs[$cLang];
}
include($lang_dir);
$site_email = "info@kmbroker.com";
$admin_email = "info@kmbroker.com";
?>
function limit_text($text, $textlength){
if(strlen($text) > $textlength) {
$stringCut = substr($text, 0, $textlength);
$text = substr($stringCut, 0, strrpos($stringCut, ' '));
$text .= " …";
}
return $text;
}
function clearDiv($mtxt){
$mytext =$mtxt;
$mytext = str_replace("
","",$mytext);
$mytext = str_replace("
","",$mytext);
return $mytext;
}
function GetStyle($txt,$cmenu=null,$pslider=0,$title=null,$og=null){
global $months,$atime,$cLang;
global $lang_dir;
include($lang_dir);
$fp=fopen("temp/temp.html","r");
$line=fread($fp,filesize("temp/temp.html"));
fclose($fp);
$line = str_replace("%dir%",SITE_DIR,$line);
if($og == null){
$og = '
';
}
$line = str_replace("%og%",$og,$line);
if($title != null)
$title = " - ".$title;
$line = str_replace("%title%",$title,$line);
$mkeywords = ", ";
$pro = mysql_query("SELECT * FROM pages");
while ($pros = mysql_fetch_array($pro)) {
$mkeywords .= $pros['title1'].", ".$pros['title2'].", ";
}
$line = str_replace("%keywords%",$mkeywords,$line);
$line = str_replace("%contact%",CONTACTTTTT,$line);
$line = str_replace("%slang%",SITE_SSLANG,$line);
$line = str_replace("%logo%",SITE_LOGO,$line);
$line = str_replace("%style%",SITE_STYLE,$line);
$line = str_replace("%prev%",LANG_PREV,$line);
$line = str_replace("%next%",LANG_NEXT,$line);
$line = str_replace("%oalign%",SITE_OALIGN,$line);
$line = str_replace("%align%",SITE_ALIGN,$line);
$line = str_replace("%callus%",SITE_CALLUS,$line);
$tlang = SITE_LANGT." : ".SITE_OLANG."";
$line = str_replace("%lang%",$tlang,$line);
$menu = "
";
$line = str_replace("%menu%",$menu,$line);
//$line = str_replace("%slider%",get_slider($pslider),$line);
$uq = mysql_query("SELECT * FROM pages WHERE pid='1'");
$urs = mysql_fetch_array($uq);
$up_txt =''.$urs[PAGE_TITLE].'
'.clearDiv($urs[PAGE_TEXT]).'
';
$line = str_replace("%up_text%",$up_txt,$line);
$fq = mysql_query("SELECT * FROM pages WHERE pid='5'");
$frs = mysql_fetch_array($fq);
$sfilling .= '
'.$frs[PAGE_TITLE].'
'.clearDiv($frs[PAGE_TEXT]).'
';
$line = str_replace("%filling%",$sfilling,$line);
$iservices =''.HOME_SERVICES.'
';
$ss=1;
$sq = mysql_query("select * from services");
while($srs = mysql_fetch_array($sq))
{
$iservices .= '- '.$srs[NEWS_TITLE].'
';
/*
if($ss >= 5)
{
$iservices .= '
';
$ss=0;
}
*/
$ss++;
}
$iservices .= '
';
$line = str_replace("%iservices%",$iservices,$line);
$line = str_replace("%footer1%",FOOTER_FOLLOW,$line);
$line = str_replace("%footer2%",HOME_FOOTER,$line);
$line = str_replace("%footer_links%",FOOTER_LINKS,$line);
$contactq = mysql_query("SELECT * FROM pages WHERE pid='6'");
$result_contact = mysql_fetch_array($contactq);
$continfo .="".$result_contact[PAGE_TITLE]."
".clearDiv($result_contact[PAGE_TEXT]);
$line = str_replace("%contactinfo%",$continfo,$line);
$line = str_replace("%text%",$txt,$line);
return $line;
}
?>
Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/kmbroker/public_html/index.php:9
Stack trace:
#0 {main}
thrown in /home/kmbroker/public_html/index.php on line 9