Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. $szamlalo = 0;
  3.  
  4. if(isset($_POST['inc'])){
  5. $szamlalo = $_POST['szamlalo'];
  6. if(strcmp($_POST['inc'], "Növel")==0)
  7. $szamlalo++;
  8. else if(strcmp($_POST['inc'], "Csökkent")==0)
  9. $szamlalo--;
  10. else
  11. $szamlalo=0;
  12. }
  13.  
  14. ?>
  15.  
  16.  
  17. <h2>Szamláló értéke: <?php echo $szamlalo;?></h2>
  18. <form action="post.php" method="POST">
  19. <input type="hidden" name="szamlalo" value="<?php echo $szamlalo;?>"/>
  20. <input type="submit" name="inc" value="Növel"/>
  21. <input type="submit" name="inc" value="Csökkent"/>
  22. <input type="submit" name="inc" value="Reset"/>
  23. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement