Advertisement
Banta_Sandra

Tugas 2

May 5th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.79 KB | None | 0 0
  1. /* Index
  2. <!DOCTYPE html>
  3. <html>
  4.         <head>
  5.                 <title>Halaman Utama</title>
  6.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  7.         </head>
  8.         <body>
  9.         <div id="container">
  10.         <div id="header"><h1 > Volume Silinder dan Suhu</h1></div>
  11.         <div id="navigation">
  12.                 <ol>
  13.                     <li><a href="silinder.php">Mencari Volume Silinder</a></li>
  14.                     <li><a href="suhu.php">Mencari Suhu Celcius Ke Fahrenheit</a></li>
  15.        
  16.                 </ol>
  17.                 </div>
  18.                
  19.                 <div id="footer">
  20.                     &copy BIT, 2013
  21.                 </div>
  22.         </body>
  23. </html>
  24.  
  25. /* Proses Silinder
  26. <?php
  27. $phi=3.14;
  28. $r =$_POST['r'];
  29. $t =$_POST['t'];
  30. $volum=$phi * $r* $r* $t;
  31. ?>
  32. <!DOCTYPE html>
  33. <html>
  34.         <head>
  35.                 <title>MENGHITUNG VOLUME SILINDER</title>
  36.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  37.         </head>
  38.         <body>
  39.         <div id="container">
  40.         <div id="header"><h1 >Hasil Hitung Volum Silinder</h1></div>
  41.                 <div id="isi">
  42.              
  43.                         <label> Jari-Jari: </label><span><?php echo $r; ?></span><br/>
  44.                         <label> Tinggi: </label><span><?php echo $t; ?></span><br/>
  45.                         <label> Volum silinder adalah: </label><?php echo $volum; ?> </span><br/>
  46.                 </div>
  47.                 <div id="footer">
  48.                     &copy BIT, 2013
  49.                 </div>
  50.         <body>
  51. </html>
  52.  
  53.  
  54.  
  55. /* Silinder
  56. <!DOCTYPE html>
  57. <html>
  58.         <head>
  59.                 <title>menghitung volum silinder</title>
  60.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  61.         </head>
  62.         <body>
  63.         <div id="container">
  64.         <div id="header"><h1 >Hitung Volume Silinder</h1></div>
  65.      <form action="prosesvolum.php"  method="post">
  66.                         <div id="isi">
  67.                                 <div id="data">
  68.                            
  69.                                         <label>Input Jari-Jari: </label><input type="text" name="r"/><br/>
  70.                                         <label>Input Tinggi: </label><input type="text" name="t"/><br/>
  71.                                 </div>
  72.                                 <div id="buttons"><input type="submit" value="Hitung"/><br/></div>
  73.                         </div>
  74.          
  75.                 </form>
  76.         </body>
  77. </html>
  78.  
  79.  
  80. /*suhu
  81. <!DOCTYPE html>
  82. <html>
  83.         <head>
  84.                 <title>Menghitung Suhu</title>
  85.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  86.         </head>
  87.         <body>
  88.         <div id="container">
  89.         <div id="header"><h1 >Hitung Suhu</h1></div>
  90.      <form action="prosessuhu.php"  method="post">
  91.                         <div id="isi">
  92.                              
  93.                                 <div id="data">
  94.                                         <label> Input suhu dalam Celcius: </label><input type="text" name="suhu_celcius"/><br/>
  95.                                 </div>
  96.                                 <div id="buttons"><input type="submit" value="konversi suhu! "/><br/></div>
  97.                         </div>
  98.                 </form>
  99.         </body>
  100. </html>
  101.  
  102. /Proses Suhu
  103. <?php
  104. $suhu_celcius =$_POST['suhu_celcius'];
  105. $suhu_fahrenheit=$suhu_celcius * 1.8 + 32;
  106. ?>
  107.  
  108. <!DOCTYPE html>
  109. <html>
  110.         <head>
  111.                 <title>MENGHITUNG SUHU</title>
  112.                 <link rel="stylesheet" type="text/css" href="style.css"/>
  113.         </head>
  114.         <body>
  115.         <div id="container">
  116.         <div id="header"><h1 >Hasil Hitung Suhu</h1></div>
  117.                 <div id="isi">
  118.                         <h2>KONVERSI SUHU</h2>
  119.                         <label> Suhu Celcius: </label><span><?php echo $suhu_celcius; ?></span><br/>
  120.                         <label> Suhu Dalam Fahrenheit: </label><?php echo $suhu_fahrenheit; ?> </span><br/>
  121.                 </div>
  122.         <body>
  123. </html>
  124.  
  125.  
  126. /* CSS
  127. #container{
  128.     margin: 0 auto;
  129.     width: 400px;
  130.     background:#569724;
  131.  
  132.     #header{
  133.     background:black;
  134.         padding: 20px;
  135.         text-align: right;
  136.  
  137. #navigation{
  138.         float: left;
  139.         width: 400px;
  140.         background:#333;
  141. }
  142.  
  143. #body{
  144.         font-family: arial, times-new-roman, sans-serif;
  145.         margin: 20px;
  146.         padding: 0;
  147.         }
  148. #isi{
  149.         width: 500px;
  150.         margin: 0 auto;
  151.         padding-right: 2em;
  152.         padding-left:2em;
  153.         background: green;
  154.         border: 1px solid purple;
  155.         }
  156.  
  157. label{
  158.         font-family: times-new-roman, sans-serif;
  159.         width:10em;
  160.         padding-right: 1em;
  161.         padding-bottom: 1em;
  162.         float: left;
  163.         }
  164. #data{
  165.         float: left;
  166.         width: 15 em;
  167.         margin-bottom: .5em;
  168.         }
  169.         #buttons input{
  170.         font-family: Comic Sans MS, sans-serif;
  171.         float: left;
  172.         margin-bottom: .5em;
  173.         }
  174.         br{clear: left;}
  175.        
  176. #footer{
  177.     background:#ccc;
  178.     text-align: center;
  179.     padding: 2px;
  180.     height: 10%;
  181. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement