PHP ile Yapılmış Hesap Makinesi Uygulaması
Aslında javascriptle yapılması daha mantıklı olan bir uygulama
<!DOCTYPE html>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
button, submit { width: 20px; height: 20px; float:left; }
.clear { clear:both }
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input, textarea, submit').bind("mouseover", function() {
$(this).css("background", "yellow");
$(this).bind("mouseout", function() {
$(this).css("background", "#ffffff");
})
})
});
</script>
</head>
<body>
<div>
<?php
$Ekran=$_POST['t1'].$_POST['t2'].$_POST['t3'];
?>
<form name="test" method="post">
<div>
<div class="clear">
<input type="text" style="width:90px; height: 30px;" disabled="disabled" value="<?php echo $Ekran ?>" />
</div>
<div class="clear">
<input type="submit" name="t1" value="1" />
<input type="submit" name="t2" value="2" />
<input type="submit" name="t3" value="3" />
</div>
<div class="clear">
<input type="submit" name="t4" value="4" />
<input type="submit" name="t5" value="5" />
<input type="submit" name="t6" value="6" />
</div>
<div class="clear">
<input type="submit" name="t7" value="7" />
<input type="submit" name="t8" value="8" />
<input type="submit" name="t9" value="9" />
</div>
<div class="clear">
<input type="submit" name="t0" value="0" />
<input type="submit" name="tn" value="." />
<input type="submit" name="te" value="=" />
</div>
</form>
</div>
</body>
</html>
<html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
button, submit { width: 20px; height: 20px; float:left; }
.clear { clear:both }
</style>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input, textarea, submit').bind("mouseover", function() {
$(this).css("background", "yellow");
$(this).bind("mouseout", function() {
$(this).css("background", "#ffffff");
})
})
});
</script>
</head>
<body>
<div>
<?php
$Ekran=$_POST['t1'].$_POST['t2'].$_POST['t3'];
?>
<form name="test" method="post">
<div>
<div class="clear">
<input type="text" style="width:90px; height: 30px;" disabled="disabled" value="<?php echo $Ekran ?>" />
</div>
<div class="clear">
<input type="submit" name="t1" value="1" />
<input type="submit" name="t2" value="2" />
<input type="submit" name="t3" value="3" />
</div>
<div class="clear">
<input type="submit" name="t4" value="4" />
<input type="submit" name="t5" value="5" />
<input type="submit" name="t6" value="6" />
</div>
<div class="clear">
<input type="submit" name="t7" value="7" />
<input type="submit" name="t8" value="8" />
<input type="submit" name="t9" value="9" />
</div>
<div class="clear">
<input type="submit" name="t0" value="0" />
<input type="submit" name="tn" value="." />
<input type="submit" name="te" value="=" />
</div>
</form>
</div>
</body>
</html>
Yorumunuzu Ekleyin