PsdBul adlı üyeden alıntı: mesajı görüntüle
Merhaba arkadaşlar bir formdan verileri post edip sayfada anlık değiştirterek işlem yapmaya çalışıyorum. post edilen veriler ekrana yazılıyor ama formdan 2 ayrı inputtan post edilen veriler bir türlü bir birini göremedi. bu 2 veriyi toplayıp sonucunu yazdırmam lazım. bilen varsa yardım bekliyorum.
umarım doğru anlamışımdır. kodlar aşağıda
<html>
<head>
	<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"></script>
	<script type="text/javascript">

	$(function(){

		/* jQuery Kodları */

		/* Ad Soyad */
		function hesapla(){
			var fiyat =$("input[name=fiyat]").val();
			var sec=$('select[name=sec] option:selected').val();
			$.ajax({
				type: "POST",
				url: "kontrol.php",
				data: "fiyat="+fiyat+"&sec="+sec,
				success : function(cevap){
				
					$("#sonuc").show().html(cevap);
				}
			});					
		}
		
		$("input[name='fiyat']").keyup(function(){
			hesapla();
		})
		
		$("select[name='sec']").click(function(){
			hesapla();
		})
		
		
			
	});
	

</script>
</head>

<body>

<form id="form" method="post">
<input type="text" id="ab" name="fiyat" value="" /> <br><br><br>
<select name="sec" id="sec">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</form>
<div id="sonuc"></div>
<div id="sonucc"></div>


</body>
</html>

<?php
$fiyat = intval($_POST["fiyat"]); 
$sec = intval($_POST["sec"]); 
$fiyat_sonuc = $fiyat * 30; 
$sec_sonuc = $sec * 30; 
$toplam_sonuc=$fiyat_sonuc+$sec_sonuc;		
echo $fiyat_sonuc.'<br>'.$sec_sonuc.'<br>'.$toplam_sonuc;					
?>