• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

PHP Hata Gösterme Fonksiyonu

The Punisher

MFC Üyesi
Üyelik Tarihi
6 Haz 2015
Konular
785
Mesajlar
930
MFC Puanı
230
PHP:
<?php ob_start(); ?> 
<style type="text/css"> 
.hata {color: blue; padding: 10px; text-decoration: underline; font-family: Arial} 
</style> 
<?php 

    ## Türkçe Karakter ## 
    header("Content-Type: text/html; charset=utf-8"); 
     
    ## Hata Verme Fonksiyonu ## 
    function hata($hata, $boyut = 1, $class = false, $renk = "#000") { 
        if($boyut >= 1 && $boyut <= 6) { 
            if($class) { 
                unset($renk); 
                echo '<h'.$boyut.' class="'.$class.'">'.$hata.'</h'.$boyut.'>'; 
                exit(); 
            }else { 
                echo '<h'.$boyut.' style="color: '.$renk.'">'.$hata.'</h'.$boyut.'>'; 
                exit(); 
            } 
        }else { 
            return false; 
        } 
    } 
     
    ## Deneyelim ## 
    $hata = "İşlem Başarısız!"; 
    $h_tagi = 3; 
    $class = "hata"; 
    $renk = "red"; 
    hata($hata, $h_tagi, "", $renk); 
     
ob_end_flush(); 
?>
 
Üst