eroare dau +multumesc

Discutii despre tot ce nu se incadreaza in celelalte categorii.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
SondOfTheTime
Membru, skill +2
Membru, skill +2
Posts: 553
Joined: 01 Aug 2011, 10:06
Detinator Steam: Da
Detinator server CS: Secret
SteamID: Privat
Reputatie: Membru Club eXtreamCS (1 luna)
Has thanked: 16 times
Been thanked: 38 times
Contact:

26 Jun 2013, 14:56

Warning: Invalid argument supplied for foreach() in /home3/hostgam1/public_html/boost/functions/functions.php on line 77
Cum rezolv eroarea
RoyalServer
SondOfTheTime
Membru, skill +2
Membru, skill +2
Posts: 553
Joined: 01 Aug 2011, 10:06
Detinator Steam: Da
Detinator server CS: Secret
SteamID: Privat
Reputatie: Membru Club eXtreamCS (1 luna)
Has thanked: 16 times
Been thanked: 38 times
Contact:

26 Jun 2013, 21:37

xeLLo ;x wrote:Warning: Invalid argument supplied for foreach() in /home3/hostgam1/public_html/boost/functions/functions.php on line 77
Cum rezolv eroarea
User avatar
marquiz
Membru, skill +1
Membru, skill +1
Posts: 285
Joined: 25 Jun 2013, 15:00
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Membru Club eXtreamCS (o luna)
Utilizator neserios ( tepar )
Location: Bucharest
Has thanked: 28 times
Been thanked: 10 times

26 Jun 2013, 21:50

Postează aici functions.php
SondOfTheTime
Membru, skill +2
Membru, skill +2
Posts: 553
Joined: 01 Aug 2011, 10:06
Detinator Steam: Da
Detinator server CS: Secret
SteamID: Privat
Reputatie: Membru Club eXtreamCS (1 luna)
Has thanked: 16 times
Been thanked: 38 times
Contact:

26 Jun 2013, 22:00

marquiz wrote:Postează aici functions.php

Code: Select all

<?php
function url($url, $err = 0) { echo "<script type='text/javascript'>window.location = '".$url."';</script>";( $err ? exit() : '' ); }

function strip_string($string){
	$a = strip_tags( addslashes( trim($string) ), '<br /><br>' );
	$a = str_replace("script", "", $a);
	return $a;
}

function first_class($ip){
	$res = explode('.', $ip);
	
	if($res[0] == '173')
		return true;
		
	return false;
}

function add_to_log($log, $time = 0){
	$fp = fopen('log_1.log', 'a');
	fwrite($fp, ($time ? date('d.m.y - H:i:s', time()).' -> ' : '' ).$log."\r\n");
	fclose($fp);
}

function get_boosted_time($time){
	$sec = time() - $time;
	
	$day = intval($sec / ( 3600 * 24 ) );
	$sec -= $day * ( 3600 * 24 );
	
	$hour = intval($sec / 3600);
	$sec -= $hour * 3600;
	
	$min = intval($sec / 60);
	$sec -= $min * 60;
	
	return '<strong>'.$day.'</strong> '.($day ? ( $day > 1 ? 'zile' : 'zi' ) : 'zile').', <strong>'.$hour.'</strong> '.($hour ? ( $hour > 1 ? 'ore' : 'oră' ) : 'ore' ).', <strong>'.$min.'</strong> '.($min ? ( $min > 1 ? 'minute' : 'minut' ) : 'minute' ).', <strong>'.$sec.'</strong> '.($sec ? ( $sec > 1 ? 'secunde' : 'secundă' ) : 'secunde' );
}

function get_country($ip){
	if(ip2long($ip)== -1 || ip2long($ip) === false){
	$stt = false ;
	}else{
	$ipDetail=array();
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, "http://api.hostip.info/get_json.php?ip=".$ip);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$dtl = json_decode(curl_exec($ch),true);
	curl_close($ch);
	$stt = array(
	'IP' => $dtl['ip'],
	'COUNTRY-NAME' => $dtl['country_name'],
	'COUNTRY-CODE' => $dtl['country_code'],
	'CITY' => $dtl['city']
	);
	}
	return $stt;
}

function print_array($array){
	if (is_array($array)){
		echo '<pre>';
		print_r($array);
		echo '</pre>';
	}
	else
	echo 'This is not an array!';

	return false;
}

function get_xml_data($obj){
	$data = $obj -> service[0] -> countries[0] -> country;
	
	$return_array = array();
	
	foreach($data as $item){
		$return_array[] = array(	'index' => (string)$item['code'],
									'keycode' => $item->prices[0]->price[0]->message_profile['keyword'],
									'shorcode' => $item->prices[0]->price[0]->message_profile['shortcode'],
									'country' => (string)$item['name'],
									'local' => $item->promotional_text[0]->local[0],
									'english' => $item->promotional_text[0]->english[0] );
	}
	
	return $return_array;
}

function get_lang($lang){
	if( strlen($lang) != 2) return 'RO';
	
	return $lang;
}

function t_rand(){ return md5(rand(123456789, 987654321)); }
function banned_server($server){
	if( strlen( $server ) < 7 || strlen( $server ) > 16 ) return t_rand();
	
	$t = explode( ".", $server );

	if( !is_numeric( $t[0] ) ) return t_rand();
	
	$sql = mysql_query("SELECT * FROM `server_banlist` WHERE `ip_address` = '".$server."'") or die(mysql_error() );
	$res = mysql_fetch_assoc($sql);
	
	if( is_numeric( $res['id'] ) ) return t_rand();
	
	return "OAt2S2CMNLEOsNVUS1evMHSKKKBHk";
}
?>
User avatar
marquiz
Membru, skill +1
Membru, skill +1
Posts: 285
Joined: 25 Jun 2013, 15:00
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Membru Club eXtreamCS (o luna)
Utilizator neserios ( tepar )
Location: Bucharest
Has thanked: 28 times
Been thanked: 10 times

26 Jun 2013, 22:08

Vezi dacă mai dă aceiaşi eroare

Code: Select all

<?php
function url($url, $err = 0) { echo "<script type='text/javascript'>window.location = '".$url."';</script>";( $err ? exit() : '' ); }

function strip_string($string){
   $a = strip_tags( addslashes( trim($string) ), '<br /><br>' );
   $a = str_replace("script", "", $a);
   return $a;
}

function first_class($ip){
   $res = explode('.', $ip);
   
   if($res[0] == '173')
      return true;
      
   return false;
}

function add_to_log($log, $time = 0){
   $fp = fopen('log_1.log', 'a');
   fwrite($fp, ($time ? date('d.m.y - H:i:s', time()).' -> ' : '' ).$log."\r\n");
   fclose($fp);
}

function get_boosted_time($time){
   $sec = time() - $time;
   
   $day = intval($sec / ( 3600 * 24 ) );
   $sec -= $day * ( 3600 * 24 );
   
   $hour = intval($sec / 3600);
   $sec -= $hour * 3600;
   
   $min = intval($sec / 60);
   $sec -= $min * 60;
   
   return '<strong>'.$day.'</strong> '.($day ? ( $day > 1 ? 'zile' : 'zi' ) : 'zile').', <strong>'.$hour.'</strong> '.($hour ? ( $hour > 1 ? 'ore' : 'oră' ) : 'ore' ).', <strong>'.$min.'</strong> '.($min ? ( $min > 1 ? 'minute' : 'minut' ) : 'minute' ).', <strong>'.$sec.'</strong> '.($sec ? ( $sec > 1 ? 'secunde' : 'secundă' ) : 'secunde' );
}

function get_country($ip){
   if(ip2long($ip)== -1 || ip2long($ip) === false){
   $stt = false ;
   }else{
   $ipDetail=array();
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, "http://api.hostip.info/get_json.php?ip=".$ip);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   $dtl = json_decode(curl_exec($ch),true);
   curl_close($ch);
   $stt = array(
   'IP' => $dtl['ip'],
   'COUNTRY-NAME' => $dtl['country_name'],
   'COUNTRY-CODE' => $dtl['country_code'],
   'CITY' => $dtl['city']
   );
   }
   return $stt;
}

function print_array($array){
   if (is_array($array)){
      echo '<pre>';
      print_r($array);
      echo '</pre>';
   }
   else
   echo 'This is not an array!';

   return false;
}

function get_xml_data($obj){
   $data = $obj -> service[0] -> countries[0] -> country;
   
   $return_array = array();
   
      $return_array[] = array(   'index' => (string)$item['code'],
                           'keycode' => $item->prices[0]->price[0]->message_profile['keyword'],
                           'shorcode' => $item->prices[0]->price[0]->message_profile['shortcode'],
                           'country' => (string)$item['name'],
                           'local' => $item->promotional_text[0]->local[0],
                           'english' => $item->promotional_text[0]->english[0] );
   }
   
   return $return_array;
}

function get_lang($lang){
   if( strlen($lang) != 2) return 'RO';
   
   return $lang;
}

function t_rand(){ return md5(rand(123456789, 987654321)); }
function banned_server($server){
   if( strlen( $server ) < 7 || strlen( $server ) > 16 ) return t_rand();
   
   $t = explode( ".", $server );

   if( !is_numeric( $t[0] ) ) return t_rand();
   
   $sql = mysql_query("SELECT * FROM `server_banlist` WHERE `ip_address` = '".$server."'") or die(mysql_error() );
   $res = mysql_fetch_assoc($sql);
   
   if( is_numeric( $res['id'] ) ) return t_rand();
   
   return "OAt2S2CMNLEOsNVUS1evMHSKKKBHk";
}
?>
SondOfTheTime
Membru, skill +2
Membru, skill +2
Posts: 553
Joined: 01 Aug 2011, 10:06
Detinator Steam: Da
Detinator server CS: Secret
SteamID: Privat
Reputatie: Membru Club eXtreamCS (1 luna)
Has thanked: 16 times
Been thanked: 38 times
Contact:

26 Jun 2013, 22:20

Parse error: syntax error, unexpected '}' in /home3/hostgam1/public_html/boost/functions/functions.php on line 86

asta imi da acum
Last edited by SondOfTheTime on 27 Jun 2013, 10:20, edited 1 time in total.
SondOfTheTime
Membru, skill +2
Membru, skill +2
Posts: 553
Joined: 01 Aug 2011, 10:06
Detinator Steam: Da
Detinator server CS: Secret
SteamID: Privat
Reputatie: Membru Club eXtreamCS (1 luna)
Has thanked: 16 times
Been thanked: 38 times
Contact:

27 Jun 2013, 10:19

ma ajuta careva
User avatar
Alexeey
Membru, skill +3
Membru, skill +3
Posts: 1191
Joined: 04 Feb 2012, 11:40
Detinator Steam: Da
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Nume anterior: Alexander132
Location: Romania,Constanta
Has thanked: 36 times
Been thanked: 58 times

27 Jun 2013, 10:22

nu mai bine repui acel fisier de la inceput de unde l-ai luat si prima oara?
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

27 Jun 2013, 11:05

Code: Select all

<?php
function url($url, $err = 0) { echo "<script type='text/javascript'>window.location = '".$url."';</script>";( $err ? exit() : '' ); }

function strip_string($string){
   $a = strip_tags( addslashes( trim($string) ), '<br /><br>' );
   $a = str_replace("script", "", $a);
   return $a;
}

function first_class($ip){
   $res = explode('.', $ip);
   
   if($res[0] == '173')
      return true;
     
   return false;
}

function add_to_log($log, $time = 0){
   $fp = fopen('log_1.log', 'a');
   fwrite($fp, ($time ? date('d.m.y - H:i:s', time()).' -> ' : '' ).$log."\r\n");
   fclose($fp);
}

function get_boosted_time($time){
   $sec = time() - $time;
   
   $day = intval($sec / ( 3600 * 24 ) );
   $sec -= $day * ( 3600 * 24 );
   
   $hour = intval($sec / 3600);
   $sec -= $hour * 3600;
   
   $min = intval($sec / 60);
   $sec -= $min * 60;
   
   return '<strong>'.$day.'</strong> '.($day ? ( $day > 1 ? 'zile' : 'zi' ) : 'zile').', <strong>'.$hour.'</strong> '.($hour ? ( $hour > 1 ? 'ore' : 'oră' ) : 'ore' ).', <strong>'.$min.'</strong> '.($min ? ( $min > 1 ? 'minute' : 'minut' ) : 'minute' ).', <strong>'.$sec.'</strong> '.($sec ? ( $sec > 1 ? 'secunde' : 'secundă' ) : 'secunde' );
}

function get_country($ip){
   if(ip2long($ip)== -1 || ip2long($ip) === false){
   $stt = false ;
   }else{
   $ipDetail=array();
   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, "http://api.hostip.info/get_json.php?ip=".$ip);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
   $dtl = json_decode(curl_exec($ch),true);
   curl_close($ch);
   $stt = array(
   'IP' => $dtl['ip'],
   'COUNTRY-NAME' => $dtl['country_name'],
   'COUNTRY-CODE' => $dtl['country_code'],
   'CITY' => $dtl['city']
   );
   }
   return $stt;
}

function print_array($array){
   if (is_array($array)){
      echo '<pre>';
      print_r($array);
      echo '</pre>';
   }
   else
   echo 'This is not an array!';

   return false;
}

function get_xml_data($obj){
   $data = $obj -> service[0] -> countries[0] -> country;
   
   $return_array = array();
   
      $return_array[] = array(   'index' => (string)$item['code'],
                           'keycode' => $item->prices[0]->price[0]->message_profile['keyword'],
                           'shorcode' => $item->prices[0]->price[0]->message_profile['shortcode'],
                           'country' => (string)$item['name'],
                           'local' => $item->promotional_text[0]->local[0],
                           'english' => $item->promotional_text[0]->english[0] );
   
   return $return_array;
}

function get_lang($lang){
   if( strlen($lang) != 2) return 'RO';
   
   return $lang;
}

function t_rand(){ return md5(rand(123456789, 987654321)); }
function banned_server($server){
   if( strlen( $server ) < 7 || strlen( $server ) > 16 ) return t_rand();
   
   $t = explode( ".", $server );

   if( !is_numeric( $t[0] ) ) return t_rand();
   
   $sql = mysql_query("SELECT * FROM `server_banlist` WHERE `ip_address` = '".$server."'") or die(mysql_error() );
   $res = mysql_fetch_assoc($sql);
   
   if( is_numeric( $res['id'] ) ) return t_rand();
   
   return "OAt2S2CMNLEOsNVUS1evMHSKKKBHk";
}
?>
Retras
Post Reply

Return to “Discutii generale”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 419 guests