PHP GET ve POST ile Veri Göndermek

GET ve POST Nedir

GET ile PHP’ye Veri Göndermek ve PHP’de Verileri Okumak

<?php 
$_isim=$_GET['isim'];
$_soyisim=$_GET['soyisim'];
echo "Hoşgeldin $_isim $_soyisim";
?>

POST ile PHP’ye Veri Göndermek ve PHP’de Verileri Okumak

<!DOCTYPE html> 
<html>
<header> <?php if(isset($_POST['gonder'])){ $_isim=$_POST['isim']; $_soyisim=$_POST['soyisim']; echo "Hoşgeldin $_isim $_soyisim"; echo "<style type='text/css'> #form_kutusu{ display:none; } </style>"; } ?> </header>
<body>
<div id="form_kutusu" />
<form action="php_post_kendine.php" method="POST">
<p>İsim</p>
<input type="text" name="isim" /><br />
<p>Soyisim</p>
<input type="text" name="soyisim" />
<p><input type="submit" name="gonder" value="Gönder" /></p>
</form>
</div>
</body>
</html>
<!DOCTYPE html> 
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="form_kutusu" />
<form action="form_oku.php" method="POST">
<p>İsim</p>
<input type="text" name="isim" /><br />
<p>Soyisim</p>
<input type="text" name="soyisim" />
<p><input type="submit" name="gonder" value="Gönder" /></p>
</form>
</div>
</body>
</html>
<!DOCTYPE html> 
<html>
<header> </header>
<body>
<?php
$_isim=$_POST['isim'];
$_soyisim=$_POST['soyisim'];
echo "Hoşgeldin $_isim $_soyisim";
?>
</body>
</html>

--

--

Full-stack Developer [ UI / UX | JAM Stack | ME(A,R,V)N | LAMP ], Author, Pro Gamer

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store