<?php
/*############################
Php ile Cpanelden Bandwidth Kontrol
Selim61 <selim61@gmail.com>
Yardım : http://www.sistembilgisi.com/web-programlama/php-ve-mysql/cpanel-bandwidth-kontrol.html
############################*/
$kullaniciadi = "kullaniciadi"; // cPanel Kullanıdı Adı
$sifre = "sifre"; // cPanel Sifreniz
$domain = "domain"; // cPanel Domain Adı
$theme = "x"; // cPanel Theme
ini_set("display_errors", "0");
$file = file_get_contents("http://$kullaniciadi:$sifre@$domain:2082/frontend/$theme/index.html") or die("<b>Critical Error, Ayarları Kontrol Ediniz</b>");
$string1 = strpos($file, "Bandwidth (this month)");
$file = substr($file,$string1);
$string2 = strpos($file, "Megabytes");
$length = strlen($file);
$take = $length - $string2;
$finally = substr($file,0,-$take);
$number = explode("<td class=\"index2\">", $finally);
$number = explode(" ",$number[1]);
$bandwidth = $number[0];
echo $bandwidth;
?>