Rabu, 08 Agustus 2012

DECIMAL TO OCTAL CONVERTER

ini coding Decimal To Octal Converternya bisa dicoba



<?php
if (isset ($_POST['decimal'])) {
    $decimal = $_POST['decimal'];
    $original = $_POST['decimal'];
    if (preg_match('/[^0-9]/', $decimal)){
        die("Maaf, inputan salah ...");
    }
    else {
 
          $oct = decoct($decimal);
   
      echo "<h2>Bilangan $original (desimal) dalam bentuk octal adalah $oct<h2>
      <h2><a href='".$_SERVER['PHP_SELF']."'>Back</a> to the script</H2>";
        }
}
else {
?>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
       <form action="<?
        echo $_SERVER ['PHP_SELF'];
                    ?>"
             method="post">
           <h1>Masukkan Bilangan Desimal Disini (Cepat !!!) </h1>
           <input type="text" size="50" name="decimal"> <br>
           <input type="submit" value="konversi">
     
       </form>
   
    </body>
</html>
<?php
}
?>


0 komentar:

Posting Komentar