PHP Hata Gösterme Fonksiyonu

0
Onaylı Üye
Üye
Katılım
31 Ocak 2013
Mesajlar
42
Tepki puanı
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
 
0
Onaylı Üye
Üye
Katılım
31 Ocak 2013
Mesajlar
42
Tepki puanı
0
Konum
Kayseri
Teşekkür ederim, sen sağ ol :)
 
Geri
Üst