<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script> $('#btn').click(function(){ $.ajax({ type:"POST", url:"gonder.php", data:$('#form').serialize(), success:function(veri){ $('#yazi').html(veri); } }); }); </script> <form id="form" name="form" method="POST" > Adı: <input type="text" name="adi" /> <br> Soyad: <input type="text" name="soyad"/> <br> <input type="submit" id="btn" value="Gönder"/> <div id="yazi"></div> </form> ------GONDER.PHP------- <?php $adi=$_POST['adi']; $soyad=$_POST['soyad']; echo "Adınız:" . $adi . "- Soyadınız" . $soyad; ?>
<html> <head> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" /> <script type="text/javascript"> $(function(){ $("a").click(function(){ $.ajax({ type:"POST", url:"gonder.php", data:$('#form1').serialize(), success:function(sonuc){ $("#icerik").html(sonuc); } }); return false }); }); </script> </head> <body> <form id="form1" name="form1" onsubmit="return false;"> Adı: <input type="text" name="isim" /> <br> Soyadı: <input type="text" name="soyisim" /> <a href=#>TIKLA </a> </form> <div id="icerik"> </div> </body> </html> Sorun Çözüldü