document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <link href="style.css" rel="stylesheet" type="text/css">
  2. <form method="POST">
  3. 0-1.000.000 Ft ig adja meg az értéket!<br>
  4. <input type=text name=osszeg><input type=submit name=submit value=Váltás!>
  5. <br>
  6. </form>
  7. <?php
  8. error_reporting(E_ALL ^ E_NOTICE);
  9.  
  10. $x = 0;
  11. if (isset($_POST[\'osszeg\'])) {$x=$_POST[\'osszeg\'];}
  12. $const=1000000;
  13.  
  14. if ($x != NULL){ // if(!empty($x)){ // if(!isset($x)){
  15.     print("Az összeg: $x").("<br>").("<br>");
  16.     $tomb=array ("20000",
  17.              "10000",
  18.              "5000",
  19.              "2000",
  20.              "1000",
  21.              "500",
  22.              "200",
  23.              "100",
  24.              "50",
  25.              "20",
  26.              "10",
  27.              "5",
  28.              "2",
  29.              "1");
  30.     $y = count($tomb);         
  31.     if ($x <= $const)
  32.     {
  33.         for ($i=0; $i<=$y; $i++)
  34.             {  
  35.             print(("Ennyi ").("$tomb[0] Ft-os kell: ").(int)($x/$tomb[0])).("<br>");
  36.             $x=$x%$tomb[0];
  37.             $tomb[0]=$tomb[$i];
  38.             }
  39.     }
  40.     else{
  41.     print("<hr>").("Írjon be 0 és $const közötti számot!");
  42.     }
  43. }
  44. ?>
');