Advertisement
HoneyRemedy

Untitled

Sep 11th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.  
  2. <form action='' method='get'>
  3.     Enter the text:
  4.     <input type='text' name='name' placeholder='name' >     <br>
  5.     Times to print:
  6.     <input type='text' name='number'>                       <br>
  7.     <input type='submit' value='Go'>
  8. </form>
  9.  
  10.  
  11. <?php
  12.  
  13. if(isset($_GET['name']) AND isset($_GET['number']) )
  14. {
  15. $data = $_GET['name'];
  16. $num = $_GET['number'];
  17.  
  18.  
  19.  
  20. echo "<br>";
  21.  
  22. for($count=0;$count<$num;$count=$count+1)
  23.     {
  24.     if($count%2)
  25.     echo "<span style='background-color:yellow;color:red'>".$data."</span> \n <br>";
  26.     else
  27.     echo $data."\n <br>";
  28.     }
  29. }
  30. else
  31. exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement