Arkadaşlar, bir hesap makinesi örneği göndereceğim. yanlız çalışmıyor
nedenini bir türlü bulamadım.. php yeni öğreniyorum..
yardımcı olursanız sevinirim..
</style>
</head>
<body>
<?php
if ($islem=="toplama")
$sonuc = $sayi_1 + $sayi_2;
if ($islem=="cikarma")
$sonuc = $sayi_1 - $sayi_2;
if ($islem=="carpma")
$sonuc = $sayi_1 * $sayi_2;
if ($islem=="bolme")
$sonuc = $sayi_1 / $sayi_2;
?>
<form method="post" action="hesapmakinesi.php">
<table width="493" height="165" border="1">
<tr>
<th colspan="4" bordercolor="#9900CC" bgcolor="#FF99FF" scope="col"><div align="center">hesap makinesi </div></th>
</tr>
<tr>
<th colspan="2" scope="row">1. Sayı:
<input name="Sayi_1" type="text" value="<?php echo $sayi_1; ?>" /></th>
<td colspan="2"><strong>2. Sayı:
<input name="Sayi_2" type="text" value="<?php echo $sayi_2; ?>" />
</strong></td>
</tr>
<tr>
<th width="121" scope="row"><div align="center">
+
<input name="islem" type="radio" value="toplama" />
</div></th>
<th width="109" scope="row"><div align="center">
-
<input name="islem" type="radio" value="cikarma" />
</div></th>
<td width="136"><div align="center">
*
<input name="islem" type="radio" value="carpma" />
</div></td>
<td width="99"><div align="center">
/
<input name="islem" type="radio" value="bolme" />
</div></td>
</tr>
<tr>
<th colspan="2" scope="row"><input type="submit" value="hesapla" name="gonder" /></th>
<td colspan="2">sonuc: <?php echo $sonuc; ?> </td>
</tr>
</table>
</form>
</body>
</html>
(server olarak wampserver kullanıyorum.. ayrı ayrı yüklemedim. bununla bir alakası olabilir mi?)

nedenini bir türlü bulamadım.. php yeni öğreniyorum..
yardımcı olursanız sevinirim..
</style>
</head>
<body>
<?php
if ($islem=="toplama")
$sonuc = $sayi_1 + $sayi_2;
if ($islem=="cikarma")
$sonuc = $sayi_1 - $sayi_2;
if ($islem=="carpma")
$sonuc = $sayi_1 * $sayi_2;
if ($islem=="bolme")
$sonuc = $sayi_1 / $sayi_2;
?>
<form method="post" action="hesapmakinesi.php">
<table width="493" height="165" border="1">
<tr>
<th colspan="4" bordercolor="#9900CC" bgcolor="#FF99FF" scope="col"><div align="center">hesap makinesi </div></th>
</tr>
<tr>
<th colspan="2" scope="row">1. Sayı:
<input name="Sayi_1" type="text" value="<?php echo $sayi_1; ?>" /></th>
<td colspan="2"><strong>2. Sayı:
<input name="Sayi_2" type="text" value="<?php echo $sayi_2; ?>" />
</strong></td>
</tr>
<tr>
<th width="121" scope="row"><div align="center">
+
<input name="islem" type="radio" value="toplama" />
</div></th>
<th width="109" scope="row"><div align="center">
-
<input name="islem" type="radio" value="cikarma" />
</div></th>
<td width="136"><div align="center">
*
<input name="islem" type="radio" value="carpma" />
</div></td>
<td width="99"><div align="center">
/
<input name="islem" type="radio" value="bolme" />
</div></td>
</tr>
<tr>
<th colspan="2" scope="row"><input type="submit" value="hesapla" name="gonder" /></th>
<td colspan="2">sonuc: <?php echo $sonuc; ?> </td>
</tr>
</table>
</form>
</body>
</html>
(server olarak wampserver kullanıyorum.. ayrı ayrı yüklemedim. bununla bir alakası olabilir mi?)