Excel Dosyası Oluşturmak

<?php
header("Content-type:application/vnd.ms-excel; charset=utf-8");
header("Cache-Control: no-store, no-cache");
header('Content-Disposition: inline; filename="dosya.xls"');
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Sayfa</title></head>
<body>
<table>
  <tr>
    <td align="left">BAŞLIK 1</td>
    <td align="left">BAŞKIK 2</td>
    <td align="left">BAŞLIK 3</td>
  </tr>
  <tr>
    <td align="left">içerik</td>
    <td align="left">içerik</td>
    <td align="left">içerik</td>
  </tr>
</table>
</body></html>

 

Üçgen Yapımı

style tagı içerisine bu kodu ekleyiniz.

.yukari {
    border-left:12px solid transparent;
    border-right:12px solid transparent;
    border-bottom:12px solid #09F;
    width:0;
    height:0;
}
 
.asagi {
    border-left:12px solid transparent;
    border-right:12px solid transparent;
    border-top:12px solid #0B0;
    width:0;
    height:0;
}
 
.sol {
    border-right:12px solid #B00;
    border-top:12px solid transparent;
    border-bottom:12px solid transparent;
    width:0;
    height:0;
}
 
.sag {
    border-left:12px solid #F60;
    border-top:12px solid transparent;
    border-bottom:12px solid transparent;
    width:0;
    height:0;
}

sayfa içerisinde bu kodu kullanın

<div class="yukari"></div>
<div class="asagi"></div>
<div class="sol"></div>
<div class="sag"></div>

 

Gelişmiş Hesap Makinesi

<HTML>
<HEAD>
<TITLE>JavaScript Gelismis Hesap Makinesi</TITLE>
<SCRIPT LANGUAGE='JavaScript'>
var displayText = ""
var num1
var num2
var operatorType

// Write to display
function addDisplay(n){
document.calc.display.value = ""
displayText += n
document.calc.display.value = displayText
}

// Addition
function addNumbers() {
if (displayText == "") {
  displayText = result
 }
num1 = parseFloat(displayText)
operatorType = "add"
displayText = ""
}

// Subtraction
function subtractNumbers() {
if (displayText == "") {
  displayText = result
 }
num1 = parseFloat(displayText)
operatorType = "subtract"
displayText = ""
}

// Multiplication
function multiplyNumbers() {
if (displayText == "") {
  displayText = result
 }
num1 = parseFloat(displayText)
operatorType = "multiply"
displayText = ""
}

// Division
function divideNumbers() {
if (displayText == "") {
  displayText = result
 }
num1 = parseFloat(displayText)
operatorType = "divide"
displayText = ""
}

// Sine
function sin() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = Math.sin(num1)
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Cosine
function cos() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = Math.cos(num1)
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// ArcSine
function arcSin() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = Math.asin(num1)
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// ArcCosine
function arcCos() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = Math.acos(num1)
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Square root
function sqrt() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = Math.sqrt(num1)
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Square number (number to the power of two)
function square() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = num1 * num1
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Convert degrees to radians
function degToRad() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = num1 * Math.PI / 180
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Convert radians to degrees
function radToDeg() {
if (displayText == "") {
  num1 = result
  }
else {
  num1 = parseFloat(displayText)
  }
if (num1 != "") {
  result = num1 * 180 / Math.PI
  document.calc.display.value = result
  displayText = ""
  }
else {
  alert("Önce bir numara yazınız")
  }
}

// Calculations
function calculate() {
if (displayText != "") {
  num2 = parseFloat(displayText)
// Calc: Addition
  if (operatorType == "add") {
    result = num1 + num2
    document.calc.display.value = result
    }
// Calc: Subtraction
  if (operatorType == "subtract") {
    result = num1 - num2
    document.calc.display.value = result
    }
// Calc: Multiplication
  if (operatorType == "multiply") {
    result = num1 * num2
    document.calc.display.value = result
    }
// Calc: Division
  if (operatorType == "divide") {
    result = num1 / num2
    document.calc.display.value = result
    }
  displayText = ""
  }
  else {
  document.calc.display.value = "Hata!"
  }
}
function clearDisplay() {
displayText = ""
document.calc.display.value = ""
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#9C6060">

<TABLE>
<TD> 
<TABLE BORDER=0 BGCOLOR="#AF9999">
<TD>
<TABLE border="0" cellpadding="2" cellspacing="2">
<FORM NAME=calc>
<TR>
	<TD COLSPAN=5><INPUT TYPE=text SIZE=22 NAME=display></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="one" VALUE="   1   " onClick=addDisplay(1)></TD>
	<TD><INPUT TYPE=button NAME="two" VALUE="   2   " onClick=addDisplay(2)></TD>
	<TD><INPUT TYPE=button NAME="three" VALUE="   3   " onClick=addDisplay(3)></TD>
	<TD><INPUT TYPE=button NAME="plus" VALUE="   +   " onClick=addNumbers()></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="four" VALUE="   4   " onClick=addDisplay(4)></TD>
	<TD><INPUT TYPE=button NAME="five" VALUE="   5   " onClick=addDisplay(5)></TD>
	<TD><INPUT TYPE=button NAME="six" VALUE="   6   " onClick=addDisplay(6)></TD>
	<TD><INPUT TYPE=button NAME="minus" VALUE="   -   " onClick=subtractNumbers()></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="seven" VALUE="   7   " onClick=addDisplay(7)></TD>
	<TD><INPUT TYPE=button NAME="eight" VALUE="   8   " onClick=addDisplay(8)></TD>
	<TD><INPUT TYPE=button NAME="nine" VALUE="   9   " onClick=addDisplay(9)></TD>
	<TD><INPUT TYPE=button NAME="multiplication" VALUE="   *     " onClick=multiplyNumbers()></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="zero" VALUE="   0   " onClick=addDisplay(0)></TD>
	<TD><INPUT TYPE=button NAME="pi" VALUE = "  Pi   " onClick=addDisplay(Math.PI)> </TD> 
	<TD><INPUT TYPE=button NAME="dot" VALUE="   .   " onClick=addDisplay(".")></TD>
	<TD><INPUT TYPE=button NAME="division" VALUE="   /   " onClick=divideNumbers()></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="sqareroot" VALUE="sqrt" onClick=sqrt()></TD>
	<TD><INPUT TYPE=button NAME="squarex" VALUE=" x^2" onClick=square()></TD>
	<TD><INPUT TYPE=button NAME="deg-rad" VALUE="d2r  " onClick=degToRad()></TD>
	<TD><INPUT TYPE=button NAME="rad-deg" VALUE="r2d  " onClick=radToDeg()></TD>
<TR align="left" valign="middle">
	<TD><INPUT TYPE=button NAME="sine" VALUE="  sin  " onClick=sin()></TD>
	<TD><INPUT TYPE=button NAME="arcsine" VALUE="asin" onClick=arcSin()></TD>
	<TD><INPUT TYPE=button NAME="cosine" VALUE="cos" onClick=cos()></TD>
	<TD><INPUT TYPE=button NAME="arccosine" VALUE="acs" onClick=arcCos()></TD>

<TR align="left" valign="middle">
	<TD COLSPAN=2><INPUT TYPE=button NAME=clear VALUE="   Temizle   " onClick=clearDisplay()></TD>
	<TD COLSPAN=3><INPUT TYPE=button NAME=enter VALUE="      =      " onClick=calculate()></TD>

</TABLE>
</TABLE>


</TABLE>
</BODY>
</HTML>

 

Basit Tema Sistemi

<?php
class template
{
	private $file		= NULL;		// -- Load File
	private $content	= NULL;		// -- File Loaded
	private $tags		= array();	// -- Tags Added
	private $count		= 0;		// -- Loop of Tags
	public function fread($archive)
	{
		$this->file = @fopen($archive, "r");
		$this->content = @fread($this->file, filesize($archive));
		if(!$this->file) exit("Error open: {$archive}");
		if(!$this->content) exit("Error read: {$archive}");
	}
	public function set($name, $value)
	{
		$this->tags[$this->count++] = array("name" => $name, "value" => $value);
	}
	public function show()
	{
		foreach($this->tags as $tags)
			$this->content = str_replace("{".$tags['name']."}", $tags['value'], $this->content);
			
		eval("?>".$this->content."<?");
	}
}
define("TITLE", "Ben Sayfa Başlığıyım"); // -- Page Title
$veri="ben bir sayfa içeriğiyim";


$template = new template(); // -- Load Class

$template->set("TITLE", TITLE); // -- Add the tag {TITLE}
$template->set("ICERIK", $veri); // -- Add the tag {ICERIK}

switch($_GET["page"])
{
	case "home" :
	$template->fread("template/index.tpl.php"); // -- Load the index.tpl.php
	break;
	default : 
	$template->fread("template/index.tpl.php"); // -- Load the index.tpl.php
	break;
}

$template->show(); // -- Show template

//alttaki html kodlarını template/index.tpl.php dosyası oluşturarak içine yazınız
/*
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{TITLE}</title>
</head>

<body>
{CONTENT}
</body>
</html>
*/
// çalıştırmak için  localhost/index.php?page=home tarzı case e göre
?>

 

Aşk Ölçer

<?php
error_reporting(4);
class lovecalc {
	function lovecalc ($firstname, $secondname) {
		$this->lovename = strtolower(preg_replace("/ /","",strip_tags(trim($firstname.$secondname))));
		$alp = count_chars($this->lovename);
		for($i=97;$i<=122;$i++){
			if($alp[$i]!=false){
				$anz = strlen($alp[$i]);
				if($anz<2){ $calc[] = $alp[$i]; }
				else{ for($a=0;$a<$anz;$a++){ $calc[] = substr($alp[$i],$a,1); } }
			}
		}
		while (($anzletter = count($calc))>2) {
			$lettermitte = ceil($anzletter/2);
			for($i=0;$i<$lettermitte;$i++){
				$sum = array_shift($calc)+array_shift($calc);
				$anz = strlen($sum);
				if($anz<2){ $calcmore[] = $sum; }
				else{ for($a=0;$a<$anz;$a++){ $calcmore[] = substr($sum,$a,1); } }
			}
			$anzc = count($calcmore);
			for($b=0;$b<$anzc;$b++){ $calc[] = $calcmore[$b]; }
			array_splice($calcmore,0);
		}
		$this->lovestat = $calc[0].$calc[1];
	}

	function showlove () {
		return "Mevcut Sevgi : %$this->lovestat";
	}
}

//örnek kullanım
?>
<html>
	<body>
	<form action="" method="get">
		Sen<input type="text" name="you" value="<?php echo @$_GET['you']; ?>"/>
		Ben<input type="text" name="me" value="<?php echo @$_GET['me']; ?>"/>
		<input type="submit" name="send" value="Hesapla"/>
	</form>
	</body>
</html>

<?php
$my_love = new lovecalc(@$_GET['you'],@$_GET['me']);
echo $my_love->showlove();
?>

 

Kredi Kartı Tanıma

<?php
error_reporting(4);
if(!defined(PHP_CREDITCARD_CLASS))
{

define(PHP_CREDITCARD_CLASS, 1);

define(UNKNOWN, 0);
define(MASTERCARD, 1);
define(VISA, 2);
define(AMEX, 3);
define(DINNERS, 4);
define(DISCOVER, 5);
define(ENROUTE, 6);
define(JCB, 7);

define(CC_OK, 0);
define(CC_ECALL, 1);
define(CC_EARG, 2);
define(CC_ETYPE, 3);
define(CC_ENUMBER, 4);
define(CC_EFORMAT, 5);
define(CC_ECANTYPE, 6);

class creditcard
{
  var $number;
  var $type;
  var $errno;

  function creditcard()
  {
    $this->number = 0;
    $this->type = UNKNOWN;
    $this->errno = CC_OK;
  }
  function check($cardnum)
  {
    $this->number = $this->_strtonum($cardnum);

    if(!$this->detectType($this->number))
    {
      $this->errno = CC_ETYPE;
      return false;
    }

    if($this->mod10($this->number))
    {
      $this->errno = CC_ENUMBER;
      return false;
    }

    return true;
  }
  function detectType($cardnum = 0)
  {
    if($cardnum)
      $this->number = $this->_strtonum($cardnum);
    if(!$this->number)
    {
      $this->errno = CC_ECALL;
      return UNKNOWN;
    }

    if(preg_match("/^5[1-5]d{14}$/", $this->number))
      $this->type = MASTERCARD;

    else if(preg_match("/^4(d{12}|d{15})$/", $this->number))
      $this->type = VISA;

    else if(preg_match("/^3[47]d{13}$/", $this->number))
      $this->type = AMEX;

    else if(preg_match("/^[300-305]d{11}$/", $this->number) ||
      preg_match("/^3[68]d{12}$/", $this->number))
      $this->type = DINNERS;

    else if(preg_match("/^6011d{12}$/", $this->number))
      $this->type = DISCOVER;

    else if(preg_match("/^2(014|149)d{11}$/", $this->number))
      $this->type = ENROUTE;

    else if(preg_match("/^3d{15}$/", $this->number) ||
      preg_match("/^(2131|1800)d{11}$/", $this->number))
      $this->type = JCB;

    if(!$this->type)
    {
      $this->errno = CC_ECANTYPE;
      return UNKNOWN;
    }

    return $this->type;
  }
  function detectTypeString($cardnum = 0)
  {
    if(!$cardnum)
    {
      if(!$this->type)
        $this->errno = CC_EARG;
    }
    else
      $this->type = $this->detectType($cardnum);

    if(!$this->type)
    {
      $this->errno = CC_ETYPE;
      return NULL;
    }

    switch($this->type)
    {
      case MASTERCARD:
        return "MASTERCARD";
      case VISA:
        return "VISA";
      case AMEX:
        return "AMEX";
      case DINNERS:
        return "DINNERS";
      case DISCOVER:
        return "DISCOVER";
      case ENROUTE:
        return "ENROUTE";
      case JCB:
        return "JCB";
      default:
        $this->errno = CC_ECANTYPE;
        return NULL;
    }
  }

  function getCardNumber()
  {
    if(!$this->number)
    {
      $this->errno = CC_ECALL;
      return 0;
    }

    return $this->number;
  }
  function errno()
  {
    return $this->errno;
  }

  function mod10($cardnum)
  {
    for($sum=0, $i=strlen($cardnum)-1; $i >= 0; $i--)
    {
      $sum += $cardnum[$i];
      $doubdigit = "".(2 * $cardnum[--$i]);
      for($j = strlen($doubdigit)-1; $j >= 0; $j--)
        $sum += $doubdigit[$j];
    }
    return $sum % 10;
  }

  function resetCard()
  {
    $this->number = 0;
    $this->type = 0;
  }

  function strError()
  {
    switch($this->errno)
    {
      case CC_ECALL:
        return "Geçersiz Arama";
      case CC_ETYPE:
        return "Bilinmeyen Kart Tipi";
      case CC_ENUMBER:
        return "Geçersiz Kart Numarası";
      case CC_EFORMAT:
        return "Geçersiz Format";
      case CC_ECANTYPE:
        return "Kart tipi taranamadı";
      case CC_OK:
        return "Başarılı";
    }
  }

  function _strtonum($string)
  {
    for($i=0; $i< strlen($string); $i++)
    {
      if(!is_numeric($string[$i]))
        continue;
      $nstr = "$nstr".$string[$i];
    }
    return $nstr;
  }

}


}

//ÖRNEK 
$cc = new creditcard;
$card=$_GET[card];
if($card)
{
  printf("%s  nolu kart %s <br>n", $card,
    (($ccret = $cc->check($card))?" gecerli":"gecersiz"));

  if($ccret)
  {
    printf("Kart Tipi: %s veya %d<br>n", $cc->detectTypeString(),
      $cc->detectType());
    printf("Kart Numarasi: %s<br>n", $cc->getCardNumber());
  }
  else
    printf("%s<br>n", $cc->strError());

}

?>

<form action="" method=get>
<input type=text name=card size=20><p>
<input type=submit value="Hesapla">
</form>

</body>

 

Google Map Koordinat Bulucu

<?php

if($_POST){
print_r($_POST);
exit;
}
?>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
  
  var placeSearch,autocomplete;
  var component_form = {
    'street_number': 'short_name',
    'route': 'long_name',
    'locality': 'long_name',
    'country': 'long_name',
    'postal_code': 'short_name'
  };
  
  function initialize() {
    autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] });
    google.maps.event.addListener(autocomplete, 'place_changed', function() {
      fillInAddress();
    });
  }
  
  function fillInAddress() {
    var place = autocomplete.getPlace();
	var lat = place.geometry.location.lat();
	var lng = place.geometry.location.lng();
    for (var component in component_form) {
      document.getElementById(component).value = "";
      document.getElementById(component).disabled = false;
	document.getElementById("long").value = lng;
	document.getElementById("lat").value = lat;
    }
    
    for (var j = 0; j < place.address_components.length; j++) {
      var att = place.address_components[j].types[0];
      if (component_form[att]) {
        var val = place.address_components[j][component_form[att]];
        document.getElementById(att).value = val;
      }
    }
  }
    
  function geolocate() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        var geolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
        autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));
      });
    }
  }

</script>
</head>
<body onload="initialize()">
	
  <div id="locationField">
    <input id="autocomplete" placeholder="Adresinizi Giriniz" onFocus="geolocate()" type="text"></input>
  </div>
  <form action="streetfindexportinput.php" method="post">
	Sokak No:<input id="street_number" disabled="true"/><br>
	Güzergah:<input id="route" disabled="true"/><br>
    Semt:<input id="locality" disabled="true"/><br>
    Posta<input id="postal_code" disabled="true"/><br>
    Ülke<input id="country" disabled="true"/><br>
    <input type="hidden" name="lng"  id="long" />
    <input type="hidden" name="lat"  id="lat" />
   <button type="submit">Gönder</button>
	</form>
	
  </body>
</html>

 

Google Map Arama ve Marker Ekleme

 

<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<?php
if($_POST){
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title></title>
  <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  <script type='text/javascript' src="http://maps.google.com/maps/api/js?sensor=true&.js"></script>
  <script type='text/javascript' src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
  <style type='text/css'>
    html,
body,
#map {
    display: block;
    width: 70%;
    height: 90%;
}
  </style>
<script type='text/javascript'>//<![CDATA[ 
$(function(){
    
    var options = {
      center : new google.maps.LatLng(<?php echo $_POST["lat"]; ?>, <?php echo $_POST["lng"]; ?>),
      zoom : 15
    };
	
    var div = document.getElementById('map');
    var map = new google.maps.Map(div, options);
    var marker = new google.maps.Marker({
        position: new google.maps.LatLng(<?php echo $_POST["lat"]; ?>,<?php echo $_POST["lng"]; ?>),
        map: map,
        title: ''
    });

});
//]]></script>

</head>
<body>
  <div id="map"></div>
</body>
</html>
<?php
}else{
?>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
  
  var placeSearch,autocomplete;
  var component_form = {
'street_address' : 'long_name',
'route' : 'long_name',//sadece sokak varsa
'country' : 'long_name',//ülke
'administrative_area_level_1' : 'long_name',//il
'administrative_area_level_2' : 'long_name',//ilçe
'administrative_area_level_3' : 'long_name',
'locality' : 'long_name',//il
'sublocality' : 'long_name',//alt bölge
'neighborhood' : 'long_name',//sadece ilçe varsa
'postal_code' : 'long_name',//posta kodu
'street_number' : 'long_name'
  };
  
  function initialize() {
    autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] });
    google.maps.event.addListener(autocomplete, 'place_changed', function() {
      fillInAddress();
    });
  }
  
  function fillInAddress() {
    var place = autocomplete.getPlace();
	var lat = place.geometry.location.lat();
	var lng = place.geometry.location.lng();
	
	var name = place.name;
    var phone = place.formatted_phone_number;
    var fullAddress = place.formatted_address;

    for (var component in component_form) {
      document.getElementById(component).value = "";
      document.getElementById(component).disabled = false;
	document.getElementById("long").value = lng;
	document.getElementById("lat").value = lat;
	document.getElementById("fa").value = fullAddress;
	
    }
    
    for (var j = 0; j < place.address_components.length; j++) {
      var att = place.address_components[j].types[0];
      if (component_form[att]) {
        var val = place.address_components[j][component_form[att]];
        document.getElementById(att).value = val;
      }
    }
  }
    
  function geolocate() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        var geolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
        autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));
      });
    }
  }

</script>
</head>
<body onload="initialize()">
	
  <div id="locationField">
    <input id="autocomplete" placeholder="Adresinizi Giriniz" onFocus="geolocate()" type="text"></input>
  </div>
  <form action="" method="post">
	Full Adres:<input id="fa" name="fa"/><br>
Cadde<input id="street_address" disabled="true"/><br>
Sokak<input id="route" disabled="true"/><br>
Ülke<input id="country" disabled="true"/><br>
İl<input id="administrative_area_level_1" disabled="true"/><br>
İlçe<input id="administrative_area_level_2" disabled="true"/><br>
Köy<input id="administrative_area_level_3" disabled="true"/><br>
Bölge<input id="locality" disabled="true"/><br>
Alt Bölge<input id="sublocality" disabled="true"/><br>
Mahalle<input id="neighborhood" disabled="true"/><br>
Posta<input id="postal_code" disabled="true"/><br>
Sokak No<input id="street_number" disabled="true"/><br>

Enlem<input type="text" name="lat"  id="lat" /><br>
Boylam<input type="text" name="lng"  id="long" /><br>
   <button type="submit">Gönder</button>
	</form>
	
  </body>
</html>
<?php } ?>

 

Eski Tarayıcılarda HTML5 Kullanabilmek

script tagı içerisinde bu kodları ekliyoruz

 (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>"; c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d<h;d++)c.createElement(e[d]);return c}};l.html5=e;q(f)})(this,document);

sayfa kodlarınızı ekleyerek test edebilirsiniz.

 <header>ulusanyazilim.com</header>
    <nav>Anasayfa</nav>
    <article>
        <section>
            HTML5
        </section>
    </article>
    <aside>
        Reklamlar
    </aside>
 <footer>Copyright</footer>

 

Eski Tarayıcılar için Placeholder Kullanımı

Öncelikle jquery kütüphanemizi script tagı ile çağırıyoruz.

http://code.jquery.com/jquery-1.10.2.min.js

script tagı içerisine kodlarımızı yazıyoruz.

;(function(window, document, $) {

    var isInputSupported = 'placeholder' in document.createElement('input');
    var isTextareaSupported = 'placeholder' in document.createElement('textarea');
    var prototype = $.fn;
    var valHooks = $.valHooks;
    var propHooks = $.propHooks;
    var hooks;
    var placeholder;

    if (isInputSupported && isTextareaSupported) {

        placeholder = prototype.placeholder = function() {
            return this;
        };

        placeholder.input = placeholder.textarea = true;

    } else {

        placeholder = prototype.placeholder = function() {
            var $this = this;
            $this
                .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
                .not('.placeholder')
                .bind({
                    'focus.placeholder': clearPlaceholder,
                    'blur.placeholder': setPlaceholder
                })
                .data('placeholder-enabled', true)
                .trigger('blur.placeholder');
            return $this;
        };

        placeholder.input = isInputSupported;
        placeholder.textarea = isTextareaSupported;

        hooks = {
            'get': function(element) {
                var $element = $(element);

                var $passwordInput = $element.data('placeholder-password');
                if ($passwordInput) {
                    return $passwordInput[0].value;
                }

                return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
            },
            'set': function(element, value) {
                var $element = $(element);

                var $passwordInput = $element.data('placeholder-password');
                if ($passwordInput) {
                    return $passwordInput[0].value = value;
                }

                if (!$element.data('placeholder-enabled')) {
                    return element.value = value;
                }
                if (value == '') {
                    element.value = value;
                    // Issue #56: Setting the placeholder causes problems if the element continues to have focus.
                    if (element != document.activeElement) {
                        // We can't use `triggerHandler` here because of dummy text/password inputs :(
                        setPlaceholder.call(element);
                    }
                } else if ($element.hasClass('placeholder')) {
                    clearPlaceholder.call(element, true, value) || (element.value = value);
                } else {
                    element.value = value;
                }
                // `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
                return $element;
            }
        };

        if (!isInputSupported) {
            valHooks.input = hooks;
            propHooks.value = hooks;
        }
        if (!isTextareaSupported) {
            valHooks.textarea = hooks;
            propHooks.value = hooks;
        }

        $(function() {
            // Look for forms
            $(document).delegate('form', 'submit.placeholder', function() {
                // Clear the placeholder values so they don't get submitted
                var $inputs = $('.placeholder', this).each(clearPlaceholder);
                setTimeout(function() {
                    $inputs.each(setPlaceholder);
                }, 10);
            });
        });

        // Clear placeholder values upon page reload
        $(window).bind('beforeunload.placeholder', function() {
            $('.placeholder').each(function() {
                this.value = '';
            });
        });

    }

    function args(elem) {
        // Return an object of element attributes
        var newAttrs = {};
        var rinlinejQuery = /^jQueryd+$/;
        $.each(elem.attributes, function(i, attr) {
            if (attr.specified && !rinlinejQuery.test(attr.name)) {
                newAttrs[attr.name] = attr.value;
            }
        });
        return newAttrs;
    }

    function clearPlaceholder(event, value) {
        var input = this;
        var $input = $(input);
        if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
            if ($input.data('placeholder-password')) {
                $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
                // If `clearPlaceholder` was called from `$.valHooks.input.set`
                if (event === true) {
                    return $input[0].value = value;
                }
                $input.focus();
            } else {
                input.value = '';
                $input.removeClass('placeholder');
                input == document.activeElement && input.select();
            }
        }
    }

    function setPlaceholder() {
        var $replacement;
        var input = this;
        var $input = $(input);
        var id = this.id;
        if (input.value == '') {
            if (input.type == 'password') {
                if (!$input.data('placeholder-textinput')) {
                    try {
                        $replacement = $input.clone().attr({ 'type': 'text' });
                    } catch(e) {
                        $replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
                    }
                    $replacement
                        .removeAttr('name')
                        .data({
                            'placeholder-password': $input,
                            'placeholder-id': id
                        })
                        .bind('focus.placeholder', clearPlaceholder);
                    $input
                        .data({
                            'placeholder-textinput': $replacement,
                            'placeholder-id': id
                        })
                        .before($replacement);
                }
                $input = $input.removeAttr('id').hide().prev().attr('id', id).show();
                // Note: `$input[0] != input` now!
            }
            $input.addClass('placeholder');
            $input[0].value = $input.attr('placeholder');
        } else {
            $input.removeClass('placeholder');
        }
    }

}(this, document, jQuery));

sayfa kodlarımızı ekliyoruz

<form>
    <input id="input" name="" type="text" placeholder="Birşeyler Arayın.."/>
</form>

en alta script tagı içerisine kodlarımızı ekliyoruz.

 $(function() {
        $('input, textarea').placeholder();
        var html;
        if ($.fn.placeholder.input && $.fn.placeholder.textarea) {
         html = '<strong>Your current browser natively supports <code>placeholder</code> for <code>input</code> and <code>textarea</code> elements.</strong> The plugin won’t run in this case, since it’s not needed. If you want to test the plugin, use an older browser ;)';
        } else if ($.fn.placeholder.input) {
         html = '<strong>Your current browser natively supports <code>placeholder</code> for <code>input</code> elements, but not for <code>textarea</code> elements.</strong> The plugin will only do its thang on the <code>textarea</code>s.';
        }
        if (html) {
         $('<p class="note">' + html + '</p>').insertAfter('form');
        }
     });