Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Problemos su kodu.

Parašė Majakas· 2010 Rugs. 29 19:09:12
#1

Sveiki, taigi turiu faila sms.php, ir kaskodel jame meta errora stai toki :


Parse error: syntax error, unexpected '}' in /home/csfun/domains/csfun.us.lt/public_html/unban/sms.php on line 33


Failas:


<?php
$SMS_engine = new SMS_engine();
include('config.php');
 
$ip = $_SERVER['REMOTE_ADDR'];
if(!in_array($ip, array('195.216.233.20', '195.216.233.21', '195.216.233.22', '195.216.233.23', '195.216.233.24', '212.122.89.91'))) {
	exit('Access denied! Code:01');
}
 
       $ex = explode(" ", $_GET[sms], 2);
	$ex[1] = strtolower($ex[1]);
	if(empty($ex[1])){
		echo "Jus neivedete ID!";
	} else if(ereg("[^0-9]", $ex[1])){
		echo "ID galibut tik is skaiciu (0-9)!";
	} else {
		$result = mysql_query("SELECT bid FROM amx_bans WHERE bid = '".$ex[1]."' LIMIT 1") or die( mysql_error());
		$row = mysql_fetch_array($result, MYSQL_ASSOC);
 
		if($row){
			$date = date("Y-m-d H:i:s");
			$result2 = @mysql_query("SELECT bid,player_nick,ban_reason FROM amx_bans WHERE bid = '".$ex[1]."' ");
			$row = mysql_fetch_array($result2, MYSQL_ASSOC);
			$nick = $row['player_nick'];
			$reason = $row['ban_reason'];
			$result3 = @mysql_query("INSERT INTO unban (`nick`,`reason`,`date`) VALUES ('$nick','$reason','$date') ");
			$result = @mysql_query("DELETE FROM amx_bans WHERE bid = '".$ex[1]."'");
     			echo $msg3;
		} else {
     			echo "Bano su id ".$ex[1]." nerasta!";
		}
	}		
} else echo "Ivyko klaida!";
 
class SMS_engine {
    var $config;
 
   function getCert($cert = null) {
      $fp = fsockopen("downloads.webtopay.com", 80, $errno, $errstr, 30);
      if (!$fp)
          exit("Cert error: $errstr ($errno)<br />\n");
      else {
          $out = "GET /download/" . ($cert ? $cert : 'public.key') . " HTTP/1.1\r\n";
          $out .= "Host: downloads.webtopay.com\r\n";
          $out .= "Connection: Close\r\n\r\n";
 
          $content = '';
 
          fwrite($fp, $out);
          while (!feof($fp)) $content .= fgets($fp, 8192);
          fclose($fp);
 
          list($header, $content) = explode("\r\n\r\n", $content, 2);
 
          return $content;
      }
   }
 
   function checkCert($cert = null) {
      $pKeyP = $this->getCert($cert);
      if (!$pKeyP) return false;
      $pKey = openssl_pkey_get_public($pKeyP);
      if (!$pKey) return false;
      $_SS2 = "";
      foreach ($_GET As $key => $value) if ($key!='_ss2') $_SS2 .= "{$value}|";
      $ok = openssl_verify($_SS2, base64_decode($_GET['_ss2']), $pKey);
      return ($ok === 1);
   }
 
   function checkTransaction()   {
      if (function_exists('openssl_pkey_get_public')) {
         if ($this->checkCert()) return true;
         return $this->checkCert('public_old.key');
      } else {
         if ($this->cSS1( $_GET['_ss1'], $this->config['your_pass'], $_GET['id'], $this->config['test'] )) {
            if ($_GET['status'] == '1') return true;
         }
         return false;
      }
   }
}
?>


Gal zinote kaip cia istaisyti ? Nes jau niekaip nerandu ;)

Redagavo Majakas· 2010 Rugs. 29 19:09:47

Parašė Pakartoti slaptažodį· 2010 Rugs. 29 19:09:31
#2


<?php
 
$SMS_engine = new SMS_engine();
 
include('config.php');
 
 
 
$ip = $_SERVER['REMOTE_ADDR'];
 
if(!in_array($ip, array('195.216.233.20', '195.216.233.21', '195.216.233.22', '195.216.233.23', '195.216.233.24', '212.122.89.91'))) {
 
	exit('Access denied! Code:01');
 
}
 
 
 
       $ex = explode(" ", $_GET[sms], 2);
 
	$ex[1] = strtolower($ex[1]);
 
	if(empty($ex[1])){
 
		echo "Jus neivedete ID!";
 
	} elseif (ereg("[^0-9]", $ex[1])){
 
		echo "ID galibut tik is skaiciu (0-9)!";
 
	} else {
 
		$result = mysql_query("SELECT bid FROM amx_bans WHERE bid = '".$ex[1]."' LIMIT 1") or die( mysql_error());
 
		$row = mysql_fetch_array($result, MYSQL_ASSOC);
 
 
 
		if($row){
 
			$date = date("Y-m-d H:idrovus");
 
			$result2 = @mysql_query("SELECT bid,player_nick,ban_reason FROM amx_bans WHERE bid = '".$ex[1]."' ");
 
			$row = mysql_fetch_array($result2, MYSQL_ASSOC);
 
			$nick = $row['player_nick'];
 
			$reason = $row['ban_reason'];
 
			$result3 = @mysql_query("INSERT INTO unban (`nick`,`reason`,`date`) VALUES ('$nick','$reason','$date') ");
 
			$result = @mysql_query("DELETE FROM amx_bans WHERE bid = '".$ex[1]."'");
 
     			echo $msg3;
 
		} else {
 
     			echo "Bano su id ".$ex[1]." nerasta!";
 
		}
 
	}		
 
} else { echo "Ivyko klaida!"; }
 
 
 
class SMS_engine {
 
    var $config;
 
 
 
   function getCert($cert = null) {
 
      $fp = fsockopen("downloads.webtopay.com", 80, $errno, $errstr, 30);
 
      if (!$fp)
 
          exit("Cert error: $errstr ($errno)<br />\n");
 
      else {
 
          $out = "GET /download/" . ($cert ? $cert : 'public.key') . " HTTP/1.1\r\n";
 
          $out .= "Host: downloads.webtopay.com\r\n";
 
          $out .= "Connection: Close\r\n\r\n";
 
 
 
          $content = '';
 
 
 
          fwrite($fp, $out);
 
          while (!feof($fp)) $content .= fgets($fp, 8192);
 
          fclose($fp);
 
 
 
          list($header, $content) = explode("\r\n\r\n", $content, 2);
 
 
 
          return $content;
 
      }
 
   }
 
 
 
   function checkCert($cert = null) {
 
      $pKeyP = $this->getCert($cert);
 
      if (!$pKeyP) return false;
 
      $pKey = openssl_pkey_get_public($pKeyP);
 
      if (!$pKey) return false;
 
      $_SS2 = "";
 
      foreach ($_GET As $key => $value) if ($key!='_ss2') $_SS2 .= "{$value}|";
 
      $ok = openssl_verify($_SS2, base64_decode($_GET['_ss2']), $pKey);
 
      return ($ok === 1);
 
   }
 
 
 
   function checkTransaction()   {
 
      if (function_exists('openssl_pkey_get_public')) {
 
         if ($this->checkCert()) return true;
 
         return $this->checkCert('public_old.key');
 
      } else {
 
         if ($this->cSS1( $_GET['_ss1'], $this->config['your_pass'], $_GET['id'], $this->config['test'] )) {
 
            if ($_GET['status'] == '1') return true;
 
         }
 
         return false;
 
      }
 
   }
 
}
 
?>

Parašė Majakas· 2010 Rugs. 29 19:09:39
#3

parse error: syntax error, unexpected '}' in /home/csfun/domains/csfun.us.lt/public_html/unban/sms.php on line 129

Redagavo ozzWANTED· 2010 Rugs. 29 19:09:10