$required_php_version = '5.6.20';
wp-includes/version.php satır 37 de yukarıdaki 5.6.20 kısmını değiştirerek geçici olarak çözüm sağlamış olacaksınız. Örneğin 5.1.20 yazabilirsiniz.
$required_php_version = '5.6.20';
wp-includes/version.php satır 37 de yukarıdaki 5.6.20 kısmını değiştirerek geçici olarak çözüm sağlamış olacaksınız. Örneğin 5.1.20 yazabilirsiniz.
<?php header('Content-Type: text/html; charset=utf-8'); class resimYukleyici{ public $isim; public $tip; public $boyut; public $gecici; public $hata; public $resim; public $kucukresim; public $mesaj; public $yeniresim; public $yenikucukresim; public function __construct(){ global $_FILES; $this->hata = $_FILES['image']['error']; if($this->hata != 0){ $this->mesaj = $this->hata; $this->mesaj; return false; }else{ $this->isim = $_FILES['image']['name']; $this->tip = $_FILES['image']['type']; $this->boyut = $_FILES['image']['size']; $this->gecici = $_FILES['image']['tmp_name']; return true; } } public function validate($maxdosyaboyutu,$minresimboyutu){ if($this->tip != 'image/jpeg' && $this->tip != 'image/gif' && $this->tip != 'image/png'){ $this->mesaj = 'Hatali dosya formati.'; return false; } if($this->boyut > $maxdosyaboyutu){ $this->mesaj = 'Dosya cok buyuk.'; return false; } $boyut = getimagesize($this->gecici); if($boyut[0] < $minresimboyutu || $boyut[1] < $minresimboyutu){ $this->mesaj = 'boyutlar cok kucuk.'; return false; }else{ return true; } } public function kirp($maxBoyut, $maxKucukBoyut){ list($orjinalgenislik, $orjinalyukseklik) = getimagesize($this->gecici); if($orjinalgenislik > $orjinalyukseklik){ $genislik = $maxBoyut; $yukseklik = intval($maxBoyut*($orjinalyukseklik/$orjinalgenislik)); $kucukgenislik = $maxKucukBoyut; $kucukyukseklik = intval($maxKucukBoyut*($orjinalyukseklik/$orjinalgenislik)); }else if($orjinalgenislik < $orjinalyukseklik){ $genislik = intval($maxBoyut*($orjinalgenislik/$orjinalyukseklik)); $yukseklik = $maxBoyut; $kucukgenislik = intval($maxKucukBoyut*($orjinalgenislik/$orjinalyukseklik)); $kucukyukseklik = $maxKucukBoyut; }else{ $genislik = $maxBoyut; $yukseklik = $maxBoyut; $kucukgenislik = $maxKucukBoyut; $kucukyukseklik = $maxKucukBoyut; } $this->resim = imagecreatetruecolor($genislik,$yukseklik); $this->kucukresim = imagecreatetruecolor($kucukgenislik, $kucukyukseklik); if($this->tip == 'image/gif'){ $kaynakresim = imagecreatefromgif($this->gecici); }else if($this->tip == 'image/jpeg'){ $kaynakresim = imagecreatefromjpeg($this->gecici); }else{ $kaynakresim = imagecreatefrompng($this->gecici); } imagecopyresampled($this->resim,$kaynakresim,0,0,0,0,$genislik,$yukseklik,$orjinalgenislik,$orjinalyukseklik); imagecopyresampled($this->kucukresim,$kaynakresim,0,0,0,0,$kucukgenislik,$kucukyukseklik,$orjinalgenislik,$orjinalyukseklik); } public function yukle($dizin,$kalite){ $uzanti = explode('.',$this->isim); $isim=date("YmdHis").rand(1,100); $this->yeniresim = $isim.'.'.$uzanti[1]; $this->yenikucukresim = $isim.'kucuk.'.$uzanti[1]; if($this->tip == 'image/gif'){ imagegif($this->resim, ($dizin.$this->yeniresim)); imagegif($this->kucukresim, $dizin.$this->yenikucukresim); } else if($this->tip == 'image/jpeg'){ imagejpeg($this->resim, $dizin.$this->yeniresim, $kalite); imagejpeg($this->kucukresim, $dizin.$this->yenikucukresim, $kalite); } else{ imagepng($this->resim,$dizin.$this->yeniresim); imagepng($this->kucukresim,$dizin.$this->yenikucukresim); } $this->mesaj = 'Dosya yuklendi.'; } } if (isset($_POST['yukle'])){ $dizin=dirname(__FILE__)."/"; $i=new resimYukleyici; $i->kirp(250,250); $i->yukle($dizin ,100); echo $i->yeniresim.'<br>'; echo '<img src="/'.$i->yeniresim.'">'; }else{ echo '<form action="" method="post" enctype="multipart/form-data"> <input type="file" name="image"> <input type="submit" name="yukle" value="Yükle"> </form>'; } ?>
Çıktısı
2018062622193729.png
<?php header('Content-Type: text/html; charset=utf-8'); class HTML_Liste { var $link,$link_baslik,$font,$renk,$tip,$bg_renk; var $dizi = array(); function HTML_Liste($dizi,$font,$renk,$bg_renk,$tip){ $this->dizi = $dizi; $this->font = $font; $this->renk = $renk; $this->tip = $tip; $this->bg_renk = $bg_renk; } function goster(){ echo "<ul style='padding-top:5px;padding-bottom:5px;background-color:$this->bg_renk;list-style-type:".$this->tip."' >"; foreach($this->dizi as $link=>$link_baslik){ echo "<a style='text-decoration:none;' href='$link'><li style='padding-top:1px;font-family:verdana; color:$this->renk; font-size:8pt font-style:bold;'>$link_baslik</li></a>"; } echo "</ul>"; } } $links = array("og.php"=>"Özgeçmiş","bilgi.php"=>"Bilgi","kurslar.php"=>"Kurslar"); $html_list = new HTML_Liste($links,'sans-serif','black','orange','disc'); $html_list->goster(); ?>
Çıktısı
<?php class zamanDamgasi { var $deger = ''; var $fark = 0; var $bicim="d.m.Y H:i:s"; function zamanDamgasi($deger='') { date_default_timezone_set('Europe/Istanbul'); if ($deger) { $this->deger = $deger; }else { $this->deger = time(); } } function yenisaat() { $deger = $this->deger; $bicim = $this->bicim; if ($this->fark) { $saniye = $this->fark*60*60; $deger = $deger + ($saniye); } return date($bicim,$deger); } function mevcutsaat() { $deger = $this->deger; $bicim = $this->bicim; return date($bicim,$deger); } function saatFarkiEkleCikar($deger) { $this->fark = $deger; } } $ts = new zamanDamgasi; $ts->saatFarkiEkleCikar(-1); echo $ts->mevcutsaat(); echo "<br>"; echo $ts->yenisaat(); ?>
Çıktısı
26.06.2018 18:21:34 26.06.2018 17:21:34
<?php header('Content-Type: text/html; charset=iso-8859-9'); class SifreleCoz { var $anahtar; var $veri; var $td; var $iv; var $bas = false; function SifreleCoz($anahtar='',$veri=''){ if ($anahtar != ''){ $this->bas($anahtar); } $this->veri = $veri; } function bas(&$anahtar){ $this->td = mcrypt_module_open ('des', '', 'ecb', ''); $this->anahtar = substr ($anahtar, 0, mcrypt_enc_get_key_size($this->td)); $iv_boyut = mcrypt_enc_get_iv_size($this->td); $this->iv = mcrypt_create_iv($iv_boyut, MCRYPT_RAND); $this->bas = true; } function anahtarAyarla($anahtar){ $this->bas($anahtar); } function veriAyarla($veri){ $this->veri = $veri; } function &anahtarGetir(){ return $this->anahtar; } function &veriGetir(){ return $this->veri; } function &sifrele($veri=''){ return $this->_sifre('sifrele',$veri); } function &coz($veri=''){ return $this->_sifre('coz',$veri); } function kapat(){ mcrypt_module_close($this->td); } function &_sifre($mode,&$veri){ if ($veri != ''){ $this->veri = $veri; } if ($this->bas){ if (mcrypt_generic_init($this->td,$this->anahtar,$this->iv) != -1){ if ($mode == 'sifrele'){ $this->veri = mcrypt_generic($this->td, $this->veri); }elseif($mode == 'coz'){ $this->veri = mdecrypt_generic($this->td, $this->veri); } mcrypt_generic_deinit($this->td); return $this->veri; }else{ trigger_error('Error basialising '.$mode.'ion handle',E_USER_ERROR); } }else{ trigger_error('Key not set. Use anahtarAyarla() method',E_USER_ERROR); } } } $sc = new SifreleCoz('gizli anahtar'); $kullanici = 'kullanici'; $sifre = 'sifre'; $s_kullanici = $sc->sifrele($kullanici); $s_sifre = $sc->sifrele($sifre); echo 'sifreli kullanici: '.$s_kullanici; echo '<br>'; echo 'sifreli sifre: '.$s_sifre; echo '<br>'; echo 'sifresiz kullanici: '.$sc->coz($s_kullanici); echo '<br>'; echo 'sifresiz sifre: '.$sc->coz($s_sifre); echo '<br>'; $sc->kapat(); ?>
Çıktısı
sifreli kullanici: £ÈÄN/©„İÂÒñ£ sifreli sifre: rtï§ğ sifresiz kullanici: kullanici sifresiz sifre: sifre
<?php class Z{ function Z($x = "", $y = "", $kartezyen = 0, $radyan = 0 ){ if( $radyan ){ $this->radyan = $radyan; } list( $this->x, $this->y ) = $this->ayir(func_get_args()); } function ayarla($radyan = 0){ $this->radyan = $radyan; return $this->radyan; } function x(){ return $this->x; } function y(){ return $this->y; } function mod(){ return hypot( $this->x, $this->y ); } function arguman(){ if( $this->radyan ){ return rad2deg( atan( $this->y / $this->x ) ); } else{ return atan( $this->y / $this->x ); } } function ekle(){ list( $x, $y ) = $this->ayir(func_get_args()); $this->x+= $x; $this->y+= $y; } function alt(){ list( $x, $y ) = $this->ayir(func_get_args()); $this->x-= $x; $this->y-= $y; } function cok(){ list( $x, $y ) = $this->ayir(func_get_args()); list( $mod, $arg ) = $this->polar( $x, $y ); list( $this->x, $this->y ) = $this->kartezyen( $this->mod()*$mod, $this->arguman()+$arg ); } function bol(){ list( $x, $y ) = $this->ayir(func_get_args()); list( $mod, $arg ) = $this->polar( $x, $y ); list( $this->x, $this->y ) = $this->kartezyen( $this->mod()/$mod, $this->arguman()-$arg ); } function ayir( $dizi ){ list ($x, $y, $kartezyen, $radyan ) = $dizi; if( $x ){ if( $y ){ if( $kartezyen == 1 ){ if( stristr( $y, "d" ) || ( ($radyan == 1) && (!stristr( $y, "d" )) ) ){ $y = deg2rad( $y ); } list( $x, $y ) = $this->kartezyen( $x, $y ); } else{ $x = $x; $y = $y; } } else{ list( $x, $y ) = $this->ayir_no( $x ); } } return array( @$x, @$y ); } function ayir_no($veri){ $veri = preg_replace("/\s*/","",$veri); if( preg_match("/(?i)[^erd\-+ij.,0-9]+/", $veri) ){ return -1; } else{ if( stristr( $veri, "e" ) ){ preg_match("/(?i)([0-9]+)e-[ij]?([0-9rd]+)[ij]?/", $veri, $dizi); if( sizeof( $dizi ) ){ if( veriiveri( $dizi[2], "d" ) ){ $dizi[2] = deg2rad( $dizi[2] ); } list( $re, $y ) = $this->kartezyen( $dizi[1], $dizi[2] ); } }else{ preg_match_all( "/(?i)([\-+]?[0-9.,ij]+)/", $veri, $dizi, PREG_SET_ORDER ); if( sizeof( $dizi ) ){ foreach( $dizi as $sayi ){ if( preg_match( "/(?i)[ij]/", $sayi[1] ) ){ $y += $sayi[1]; }else{ $re += $sayi[1]; } } } } return array($re, $y); } } function kartezyen( $mod, $a ){ return array( ( $mod*cos($a) ), ( $mod*sin($a) ) ); } function polar( $re, $y ){ return array( hypot( $re, $y ) , atan( ($y/$re) ) ); } } print_r(new Z($x = "5", $y = "6", $kartezyen = 0, $radyan = 0 )); echo "<br>"; print_r(new Z($x = "5", $y = "6", $kartezyen = 0, $radyan = 1 )); echo "<br>"; print_r(new Z($x = "5", $y = "6", $kartezyen = 1, $radyan = 0 )); echo "<br>"; print_r(new Z($x = "5", $y = "6", $kartezyen = 1, $radyan = 1 )); ?>
Çıktısı
Z Object ( [y] => 6 [x] => 5 ) Z Object ( [radyan] => 1 [y] => 6 [x] => 5 ) Z Object ( [y] => -1.3970774909946 [x] => 4.8008514332518 ) Z Object ( [radyan] => 1 [y] => 0.52264231633827 [x] => 4.9726094768414 )
<?php class benzersizOturumKimligi{ var $ip; var $karaktersil; function benzersizOturumKimligi($mod = "normal"){ global $X_HTTP_FORWARDED_FOR, $REMOTE_ADDR; $this->karaktersil = "."; if(!isset($X_HTTP_FORWARDED_FOR)){ $this->ip = $REMOTE_ADDR; }else{ $this->ip = $X_HTTP_FORWARDED_FOR; } if($mod == "gelismis"){ return $this->karakterkaldir(md5(time().$this->ip).$this->rand_num($mod), $this->karaktersil); }else{ return $this->karakterkaldir(time().$this->ip.$this->rand_num($mod), $this->karaktersil); } } function karakterkaldir($metin, $karakter, $y = ""){ $m = explode($karakter, $metin); while(list($anahtar, $deger) = each($m)){ $y.= $deger; } return $y; } function rand_num($mod){ if($mod == "gelismis"){ srand ((double)microtime()*1000000); return rand(getrandmax()/2000, getrandmax()).rand(); } else{ srand ((double)microtime()*1000000); return rand(); } } } $sess = new benzersizOturumKimligi; echo $sess->benzersizOturumKimligi()."<br>"; echo $sess->benzersizOturumKimligi("gelismis"); ?>
Çıktısı
153001689518430 7c93ad34f4d467fa10a2306618b856d41843715199
<?php class UzakDosyaKontrol { var $hata; var $hatano; var $hatamesaj; var $sunucu; var $tarih; var $boyut; var $tip; var $httpcevir = array('Server' => 'sunucu', 'Last-Modified' => 'tarih', 'Content-Length' => 'boyut', 'Content-Type' => 'tip' ); var $istatistik = array('sunucu' => '', 'tarih' => '', 'boyut' => '', 'tip' => '' ); function UzakDosyaKontrol($sunucu, $file, $port = 80) { $file = preg_replace("#^\/|^#i", "/", $file); $this->hata = false; $fp = fsockopen ($sunucu, $port, $this->hatano, $this->hatamesaj, 30); if($fp) { fputs ($fp, "HEAD $file HTTP/1.0\r\n"); fputs ($fp, "Host: $sunucu\r\n" ); fputs ($fp, "\r\n"); while(!feof($fp)) { $satir = fgets($fp,4096); if(preg_match("/^([a-zA-Z\-]+): ([[:ascii:]]+)$/", $satir, $dizi)) { if(isset($this->httpcevir[$dizi[1]])) { $this->istatistik[$this->httpcevir[$dizi[1]]] = $dizi[2]; } } } } else { $this->hata = true; } } function sunucugetir() { return $this->istatistik['sunucu']; } function tarihgetir() { return date("d.m.Y H:i:s",strtotime($this->istatistik['tarih'])); } function boyutgetir() { return $this->istatistik['boyut']; } function tipgetir() { return $this->istatistik['tip']; } function hatagetir() { return $this->hata; } function hatamesajgetir() { return $this->hatamesaj; } function hatanogetir() { return $this->hatano; } } $r = new UzakDosyaKontrol('www.google.com.tr', 'images/branding/googlelogo/2x/googlelogo_color_272x92dp.png'); if($r->hata) { echo $r->hatamesajgetir(), '(', $r->hatanogetir(), ')<br>'; }else{ echo $r->sunucugetir(), '<br>',$r->tarihgetir(), '<br>',$r->boyutgetir(), 'bayt<br>',$r->tipgetir(), '<br>'; } ?>
Çıktısı
sffe 08.12.2016 02:00:57 13504 bayt image/png
<?php class Damgalar { var $tdizi = array(); var $i = 0; function Damgalar($yorum = '') { $this->sureEkle($yorum); } function sureEkle($yorum = '') { $this->tdizi[$this->i][0] = $this->sureGetir(); $this->tdizi[$this->i][1] = $yorum.(empty($yorum) ? 'timestamp'.$this->i : '' ); $this->i++; } function sureGetir() { list($usaniye, $saniye) = explode(' ', microtime()); return ((float)$usaniye + (float)$saniye); } function boyutGetir() { if (sizeof($this->tdizi) < 2) $this->sureEkle('last timestamp'); return ( $this->tdizi[sizeof($this->tdizi)-1][0] - $this->tdizi[0][0] ); } function diziGetir() { $odizi = array(); for ($x=1; $x<sizeof($this->tdizi); $x++) { $odizi[$x][0] = $this->tdizi[$x][0] - $this->tdizi[$x-1][0]; $odizi[$x][1] = $this->tdizi[$x-1][1].'-'.$this->tdizi[$x][1]; } return $odizi; } function yazdir() { $odizi = $this->diziGetir(); echo '<table border="1"><tr bgcolor="#cccccc"><td><b>Sure</b></td><td><b>Aciklama</b></td></tr>'; for ($x=1; $x<sizeof($this->tdizi); $x++) { echo '<tr> <td>'.number_format($odizi[$x][0], 14, '.', ' ').'</td> <td>'.$odizi[$x][1].'</td> </tr>'; } echo '</table>'; } } $ts = new Damgalar('blok1'); $ts->sureEkle('blok2'); $ts->sureEkle('block3'); echo 'Sayfa '.$ts->boyutGetir().' saniyede olusturuldu'; $ts->yazdir(); ?>
Çıktısı
Sayfa 0.0010001659393311 saniyede olusturuldu Sure Aciklama 0.00000000000000 blok1-blok2 0.00100016593933 blok2-block3
<?php class Haftabul { var $damga; function __construct($tarih){ if (is_int ($tarih)) $this->damga = $tarih; else { if (preg_match ("/^[\d]{4}\/([0]?\d|1[0-2])\/([1-2][0-9]|3[0-1]|[0]?[1-9])$/", $tarih)) { $gecici = explode ("/", $tarih); if (checkdate ($gecici [1], $gecici [2], $gecici [0])) $this->damga = mktime (0, 0, 0, $gecici [1], $gecici [2], $gecici [0]); } } } function KacinciHafta(){ if (isset ($this->damga)) $tdamga = $this->damga; else return (false); $gun = date ("z", $tdamga) + 1; $hafta = ($gun >= 7 ? ceil ($gun / 7) : 1); return $hafta; } } $a=new Haftabul("2018/06/22"); echo $a->KacinciHafta(); ?>
Çıktısı
25