Basit POST veya GET Değişkenlerini Filitreleme
<!DOCTYPE html>
<html>
<head>
<title>Filitre</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
</style>
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
</head>
<body>
<?php
if (isset($_POST)) {
$adi = Filitre($_POST["adi"]);
$yasi = Filitre($_POST["email"]);
$adresi = Filitre($_POST["adres"]);
echo "$adi $yasi $adresi";
}
function Filitre($Veri) {
$Veri = trim($Veri); //en başındaki ve en sonundaki boşluklar silinir
$Veri = stripslashes($Veri);
$Veri = htmlspecialchars($Veri);
return $Veri;
}
?>
<div id="divimiz">
<form name="filitre_denemesi" method="post" enctype="multipart/form-data" style="padding: 10px;">
<div>Adınız <input type="text" name="adi" /></div>
<div>Yaşınız <input type="text" name="yasi" /></div>
<div>Adresiniz <input type="text" name="adres" /></div>
<div> <input type="submit" />
</form>
</div>
</body>
</html>
<html>
<head>
<title>Filitre</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
</style>
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
});
</script>
</head>
<body>
<?php
if (isset($_POST)) {
$adi = Filitre($_POST["adi"]);
$yasi = Filitre($_POST["email"]);
$adresi = Filitre($_POST["adres"]);
echo "$adi $yasi $adresi";
}
function Filitre($Veri) {
$Veri = trim($Veri); //en başındaki ve en sonundaki boşluklar silinir
$Veri = stripslashes($Veri);
$Veri = htmlspecialchars($Veri);
return $Veri;
}
?>
<div id="divimiz">
<form name="filitre_denemesi" method="post" enctype="multipart/form-data" style="padding: 10px;">
<div>Adınız <input type="text" name="adi" /></div>
<div>Yaşınız <input type="text" name="yasi" /></div>
<div>Adresiniz <input type="text" name="adres" /></div>
<div> <input type="submit" />
</form>
</div>
</body>
</html>
Yorumunuzu Ekleyin