İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

PHP Hata Gösterme Fonksiyonu

serjey

0
İyinet Üyesi
Katılım
1 Şubat 2013
Mesajlar
42
Reaction score
0
Konum
Kayseri
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();
?>

Demo: demo.serhatyuna.tk/iyinet/hata.php
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst