Dünyanın En Hızlı Alan Adı Sorgulama Sistemi

Demo

http://ulusanyazilim.com/works/domain/

Mantık

<?php 
error_reporting(0);
$url='http://who.is/whois/'.$_POST["sorguc"];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_URL, $url);
$html = curl_exec($ch);
$html =  file_get_contents($url);
@preg_match('#<pre(.*?)pre>#si',$html,$value);	
@preg_match('#queryResponseHeader (.*?)">#si',$html,$sonuc);
if(strlen(strstr($value[1], "No match found")) > 0){
	echo '<div class="alert alert-success" role="alert">'.$_POST["sorguc"].' Uygun.</div>';
}elseif($sonuc[1] != "hidden"){
	echo '<div class="alert alert-danger" role="alert">'.$_POST["sorguc"].' Alınmış.</div>';
}elseif(strlen(strstr($value[1], "No match found")) == 0 ){
	if(strstr($_POST["sorguc"], ".tr")){
		echo '<div class="alert alert-danger" role="alert">'.$_POST["sorguc"].' Alınmış.</div>';
	}else{
		echo '<div class="alert alert-success" role="alert">'.$_POST["sorguc"].' Uygun.</div>';
	}
}else{	
	echo '<div class="alert alert-success" role="alert">'.$_POST["sorguc"].' Uygun.</div>';
}
?>

Bülten Abonelik Sistemi

Kullanıcıların email ve ip adreslerini excel dosyasına kaydederek bir nevi bülten veritabanı oluşturmuş olursunuz. Geriye bu verileri işleyerek onlara mail göndermek size kalmış.

<!doctype html>
<html>
<meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1"><form>
<input name="email" type="email" placeholder="E-mail">
<button type="submit">Bültene Abone Ol</button>
</form>
</html>
<?php 
if(isset($_REQUEST['email'])){
	if (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {
		exit;
	}
	$FileOp = fopen('emails.csv', 'a');
	if ($FileOp) {
		$emails = file('emails.csv');					
		$inList = false;
		$i = 1;
		foreach($emails as $k => $v) {
				$i++;	
			$email = explode(',', $v);
			if ($_REQUEST['email'] == $email[1]) {
				$inList = true;
				break;
			}
		}
		if (!$inList) {
			$Server_IP  = $_SERVER['SERVER_ADDR'];
			$emails =$_REQUEST['email'];
			fputcsv($FileOp,array($i,$emails,$Server_IP));
			fclose($FileOp);				
		}
	}
	header("Location: ?eklendi");
}

 

Dikey Menü Mouse Efekti

<!doctype html>
<html>
<head>
  <meta charset='utf-8'>
  <style>
body{padding: 0;margin: 0;border: 0;line-height: 1;}
ul,li{list-style: none;margin: 0;padding: 0;}
a{
  display: block;
  text-decoration: none;
  font-family: Arial,Tahoma,verdana, sans-serif;
  padding: 15px;
  color: #ffffff;
  font-size:12px;
  background: #333333;
  transition: all 0.3s ease;
}
#menu {
  position: relative;
  float: left;
}
#menu li {
  float: none;
  min-height: 1px;
  line-height: 1em;
  vertical-align: middle;
  position: relative;
}
#menu li.hover,#menu li:hover {
  position: relative;
  cursor: default;
}
#menu li a {/*ana menü*/
  color: #ffffff;
}
#menu li a:hover,#menu li:hover a,#menu li:hover ul {/*ana hover tüm arka plan*/
  background: #111133;
  visibility: visible;
}
#menu ul {
  visibility: hidden;
  position: absolute;
  width: 100%;
  top: 0px;
  left: 99%;
}
#menu ul li:hover a {/*alt menü hover*/
  background: #555f5f;
  color: #ffffff;
}
</style>
</head>
<body>
	<ul id='menu'>
	  <li><a href='#'><span>Menü1</span></a>
		  <ul>
			 <li ><a href='#'><span>A1</span></a></li>
			 <li ><a href='#'><span>A2</span></a></li>
		  </ul>
	   </li>
	   <li><a href='#'><span>Menü2</span></a>
		  <ul>
			 <li ><a href='#'><span>B1</span></a></li>
			 <li ><a href='#'><span>B2</span></a></li>
		  </ul>
	   </li>
	</ul>
</body>
<html>

 

Bütçe Hesaplama

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <style>
        #container{
            padding-right: 15px;
            padding-left: 15px;
            padding-top: 15px;
            margin-right: auto;
            margin-left: auto;
        }
        table td{
            margin: 20px;
        }

        input{
            cursor: pointer;
        }
        #info{
            color:#ff1121;
            font-weight: bold;
        }
        #education .color,#educationBar{
            background: #4986E7;
        }
        #environment .color,#environmentBar{
            background: #16A765;
        }
        #military .color,#militaryBar {
            background: #E9B330;
        }
        #health .color,#healthBar{
            background: #ff1121;
        }
        #crime .color,#crimeBar{
            background: #A076DD;
        }
        .meter{
            background: #555;
            -moz-border-radius: 10px;
            -webkit-border-radius: 10px;
            border-radius: 10px;
            padding: 5px;
        }
        .meter span {
            background: #eff151;
            border-radius: 5px;
            height: 10px;
            display: block;
        }
        .color{
            width: 25px;
            height: 25px;
            border: 1px #000000 solid;
            float: left;
        }
        .bar{
            width: 50px;
            float: left;
            border: 1px rgba(255, 255, 255, 0) solid;
            margin-left: 10px;
        }

        #chart{
            border: 1px #000000 solid;
            width: 325px;
            height: 250px;
            float: left;
            padding: 10px;
        }

    </style>
</head>
<body>
<div id="container">

    <div id="overAll">
        <table>
            <tr>
                <td style="width: 200px;"> <label>Toplam:  <span id="total"> 0%</span></label> </td>
                <td> : </td>
                <td style="width: 300px">
                    <div class="meter">
                        <span style="width: 0"></span>
                    </div>
                </td>
                <td id="info"> ! Bütçenizi Aşıyor </td>
            </tr>
        </table>
    </div>
    <br>
    <div style="width: 100%;float: left;margin-left: 0px">
        <div id="chart">
            <span id="educationBar" class="bar"></span>
            <span id="environmentBar" class="bar"></span>
            <span id="militaryBar" class="bar"></span>
            <span id="healthBar" class="bar"></span>
            <span id="crimeBar" class="bar"></span>
        </div>
    </div>
    <div id="division" style="float: left;margin-top: 2%">
        <table>
            <tr id="education">
                <td> <label>Eğitim:  <span> 0%</span></label> </td>
                <td><span class="color"></span> : </td>
                <td> <input type="range" min="0" max="100" value="0"/> </td>
            </tr>
            <tr id="environment">
                <td> <label>Çevre:  <span> 0%</span></label> </td>
                <td><span class="color"></span> : </td>
                <td> <input type="range" min="0" max="100" value="0"/> </td>
            </tr>
            <tr id="military">
                <td> <label>Güvenlik:  <span> 0%</span></label> </td>
                <td><span class="color"></span> : </td>
                <td> <input type="range" min="0" max="100" value="0"/> </td>
            </tr>
            <tr id="health">
                <td> <label>Sağlık:  <span> 0%</span></label> </td>
                <td><span class="color"></span> : </td>
                <td> <input type="range" min="0" max="100" value="0"/> </td>
            </tr>
            <tr id="crime">
                <td style="width: 200px;"> <label>Barınma:  <span> 0%</span></label> </td>
                <td><span class="color"></span> : </td>
                <td> <input type="range" min="0" max="100" value="0"/> </td>
            </tr>
        </table>
    </div>
</div>
<script>

    $(function(){

        $("#info").hide();
        var education,environment,military,health,crime;
        var total,chartValues;
        $("table").on("change mousemove",function(){
            education = $("#education").find("input").val();
            environment = $("#environment").find("input").val();
            military = $("#military").find("input").val();
            health = $("#health").find("input").val();
            crime = $("#crime").find("input").val();
            total=(Number(education/5)+Number(environment/5)+Number(military/5)+Number(health/5)+Number(crime/5));
            chartValues =[Number(education),Number(environment),Number(military),Number(health),Number(crime)];
            console.log(chartValues);
            valueUpdate();
        });
        function valueUpdate(){
            $("#education").find("label").find("span").text(education+"%");
            $("#environment").find("label").find("span").text(environment+"%");
            $("#military").find("label").find("span").text(military+"%");
            $("#health").find("label").find("span").text(health+"%");
            $("#crime").find("label").find("span").text(crime+"%");
            console.log(total);
            $("#educationBar").css({"height":education+"%"});
            //$("#educationBar").css({"height":education+"%","margin-top":education+"%"});
            $("#environmentBar").css({"height":environment+"%"});
            $("#militaryBar").css({"height":military+"%"});
            $("#healthBar").css({"height":health+"%"});
            $("#crimeBar").css({"height":crime+"%"});
            $("#overAll").find("progress").val(Math.ceil(total));
            $("#total").text(Math.ceil(total)+"%");
            $(".meter").find("span").width(Math.ceil(total)+"%");
            if(total>50){
                $("#info").show();
            }
            else{
                $("#info").hide();
            }
        }
    });
</script>
</body>
</html>

 

Arazi Sorgulama

Anlık arama yapın

<?php //arazi.php içeriği
set_time_limit(0);
header('Content-Type: text/html; charset=utf-8');
if(!file_exists("cache")){mkdir("cache", 0777);}
function iller(){
	if(!file_exists("cache/iller.json")){
		$il=file_get_contents("http://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/idariYapi/ilListe");
		file_put_contents("cache/iller.json",$il); 
	}else{
		$il=file_get_contents("cache/iller.json");
	}
	$il=json_decode($il,true);
	$iller=null;
	foreach($il["features"] as $il){
		$iller[]=$il["properties"];
	}
	return $iller;
}
if(isset($_POST["il"])){
	if(!file_exists("cache/".$_POST["il"].".json")){
		$ilce=file_get_contents("http://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/idariYapi/ilceListe/".$_POST["il"]);
		file_put_contents("cache/".$_POST["il"].".json",$ilce); 
	}else{
		$ilce=file_get_contents("cache/".$_POST["il"].".json");
	}
	$ilce=json_decode($ilce,true);
	$ilceler=null;
	echo '<select id="ilce" class="form-control">';
	echo '<option>Seçiniz</option>';
	foreach($ilce["features"] as $ilce){
		echo '<option value="'.$ilce["properties"]["id"].'">'.$ilce["properties"]["text"].'</option>';
	}
	echo '</select>';
	echo '<script type="text/javascript">
	$(document).ready(function() {
		$("#sonuc").html("Seçmeye Devam Ediniz...");
		$("#ilce").bind("change",function(){
			if($("#ilce").val() != 0){
				var ilce=$("#ilce option:selected").val();
				var ilcetext=$("#ilce option:selected").text();
				$.ajax({
					type: "POST",
					url: "arazi.php",
					data: "ilce="+ilce,
					dataType: "html",
					beforeSend: function() {
						$("#ilce").after("<label id=\"ilce\" class=\"bg-secondary text-white form-control\">"+ilcetext+"</label>");
						$("#ilce").remove();
					},
					success: function(data) {
						$("#ilce").after(data);
					}
				});
			}
		});
	});
	</script>';
}elseif(isset($_POST["ilce"])){
	if(!file_exists("cache/".$_POST["ilce"].".json")){
		$mahalle=file_get_contents("http://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/idariYapi/mahalleListe/".$_POST["ilce"]);
		file_put_contents("cache/".$_POST["ilce"].".json",$mahalle); 
	}else{
		$mahalle=file_get_contents("cache/".$_POST["ilce"].".json");
	}
	$mahalle=json_decode($mahalle,true);
	$mahalleler=null;
	echo '<select id="mahalle" class="form-control">';
	echo '<option>Seçiniz</option>';
	foreach($mahalle["features"] as $mahalle){
		echo '<option value="'.$mahalle["properties"]["id"].'">'.$mahalle["properties"]["text"].'</option>';
	}
	echo '</select>';
	echo '<script type="text/javascript">
	$(document).ready(function() {
		$("#sonuc").html("Seçmeye Devam Ediniz...");
		$("#mahalle").bind("change",function(){
			if($("#mahalle").val() != 0){
				var mahalle=$("#mahalle option:selected").val();
				var mahalletext=$("#mahalle option:selected").text();
				$.ajax({
					type: "POST",
					url: "arazi.php",
					data: "mahalle="+mahalle,
					dataType: "html",
					beforeSend: function() {
						$("#mahalle").after("<label id=\"mahalle\" class=\"bg-secondary text-white form-control\">"+mahalletext+"</label>");
						$("#mahalle").remove();
					},
					success: function(data) {
						$("#mahalle").after(data);
					}
				});
			}
		});
	});
	</script>';
}elseif(isset($_POST["mahalle"])){
	echo '<input type="number" id="ada" class="form-control" placeholder="Ada">';
	echo '<input type="number" id="parsel" class="form-control" placeholder="Parsel">';
	echo '<script type="text/javascript">
	$(document).ready(function() {
		$("#sonuc").html("Ada ve Parsel Bilgisi Giriniz...");
		$("#ada,#parsel").on("input",function(){
			var ada=$("#ada").val();
			var parsel=$("#parsel").val();
			if(ada > 0 && parsel > 0){
				var mahalle='.$_POST["mahalle"].';
				$.ajax({
					type: "POST",
					url: "arazi.php",
					data: "veri="+mahalle+"/"+ada+"/"+parsel,
					dataType: "html",
					beforeSend: function() {
						$("#sonuc").html("Sorgulanıyor...");
					},
					success: function(data) {
							$("#sonuc").html(data);
					}
				});
			}
		});
	});
	</script>';
}elseif(isset($_POST["veri"])){
	if(!file_exists("cache/".str_replace("/","-",$_POST["veri"]).".json")){
		$parsel=file_get_contents("http://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/parsel/".$_POST["veri"]);
		file_put_contents("cache/".str_replace("/","-",$_POST["veri"]).".json",$parsel); 
	}else{
		$parsel=file_get_contents("cache/".str_replace("/","-",$_POST["veri"]).".json");
	}
	$parsel=json_decode($parsel,true);
	if($parsel["properties"]){
	foreach($parsel["properties"] as $title=>$key){
		echo '<label class="bg-success text-white form-control">'.ucfirst($title)." : ".$key."</label>";
	}
	}else{
		echo '<label class="bg-danger text-white form-control">Sonuç Bulunamadı</label>";
	}

}

/* ada 1 parsel 2

https://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/idariYapi/mahalleListe/648

ada 5 parsel 3
https://cbsservis.tkgm.gov.tr/megsiswebapi.v2/api/parsel/144808/5/3

 */

?>

http://ulusanyazilim.com/works/arazi