<html> <head> <style> @keyframes tst{ 0%{top : 45%;left :70%; background-color:green;color :black} 25%{top : 80%;left :70%; background-color:red;} 50%{top : 80%;left :5%; background-color:blue;} 75%{top : 10%;left :5%; background-color:yellow;} 100%{top : 10%;left :70%; background-color:black;color : red;} } #test{ position : absolute; top : 35%; left :35%; bottom : 35%; right : 35%; background-color : red ; text-align : center; } #test2{ position : absolute; top : 45%; left :70%; width : 200px; height : 50px; background-color : green ; text-align : center; animation : tst 10s infinite; } #idCenter{ position : absolute; top : 35%; left : 15%; } </style> </head> <body> <div id="test"> <div id ="idCenter"> <form method="post" action="" > x = <input type="text" name="x" /><br> y = <input type="text" name="y" /><br> <input type="submit" name="btnSum" value="جمع"/> </form> </div> </div> <?php $sum = 0; if(ISSET($_POST['btnSum'])){ $a = $_POST['x']; $b = $_POST['y']; $sum = $a + $b ; $link = new mysqli("localhost","root","",'test'); $q="insert into tblsum(x,y,sum) values ('$a','$b',$sum)"; $link->Query($q); } echo "<p id='test2'>sum is = ".$sum."</p>"; ?> </body> </html>
فایل mysql در پیوست