Guest User

Untitled

a guest
Jun 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Ikä</title>
  5. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  6. </head>
  7. <body>
  8. <form action="" method="post">
  9. Teksti: <input type="text" name="input"> <br />
  10. Monta kertaa pärisee ;D: <input type="text" name="amount"> <br />
  11. <input type="submit" value="Lähetä">
  12. </form>
  13.  
  14. <?php
  15. for($o = 0; $o < $_POST['amount']; $o++) {
  16. for($i = 0; $i < strlen($_POST['input']); $i++) {
  17. if ($i % 2 == 0)
  18. print '<span style="color:red">' . $_POST['input'][$i] . '</span>';
  19. else
  20. print '<span style="color:blue">' . $_POST['input'][$i] . '</span>';
  21. }
  22. }
  23. ?>
  24. </body>
  25. </html>
Add Comment
Please, Sign In to add comment