Advertisement
bulfaitelo

cor 20/08/212

Aug 21st, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.10 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  3.  
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  6.     <meta name="author" content="MESMERiZE" />
  7.  
  8.     <title>Untitled 2</title>
  9. </head>
  10.  
  11. <body>
  12. <form action="cor.php" method="post">
  13. <li><b>contador... de cores</li>
  14. <input type="text" name="contador" id="contador" value="10"/>
  15. <li>Red escolha de 0 a 255<br /><br /></li>
  16. <input type="text" name="red" id="red" value="10"/>
  17. <li>Green escolha de 0 a 255<br /></li>
  18. <input type="text" name="green" id="green" value="10"/>
  19. <li>Blue escolha de 0 a 255</b><br /></li>
  20. <input type="text" name="blue" id="blue" value="10"/>
  21. <input type="submit" name="manda vê"/>
  22. </form>
  23.  
  24.  
  25. <?php
  26.  $contador = $_POST['contador'];
  27.  $red = $_POST['red'];
  28.  $green = $_POST['green'];
  29.  $blue = $_POST['blue'];
  30.  
  31. //   $cont_red= '0';
  32. //   $cont_green ='0';
  33. //   $cont_blue = '0';
  34.  
  35.  
  36.  
  37.  for ($cont_alto= 0;$cont_alto < $contador;$cont_alto++)
  38.  {
  39.    if($red < 255)
  40.    {
  41.        $red= ($red + 1);
  42.    }
  43.    if ($red == 255)
  44.    {
  45.        if($green < 255)
  46.        {
  47.            $green = ($green +1);
  48.        }
  49.    }
  50.    if ($green == 255)
  51.    {
  52.        if($blue < 255)
  53.        {
  54.            $blue = ($blue + 1);
  55.        }
  56.    }
  57.  print "<b style='color:rgb(<?php echo $red ?>, <?php echo $green ?>, <?php echo $blue ?>);'>o</b>" ;
  58.    
  59.    /*  print $cont_alto ."<br/>" ;
  60.    print "red " . $red . " ";
  61.    print "gren " . $green . " ";    
  62.    print "blue " . $blue . "<br/>";        */
  63.  
  64.  
  65.   }
  66.    
  67.  
  68.  
  69.  
  70.  
  71.  //   echo  ("<b>contador" . $_POST['contador'] . "</b><br/>");
  72.   //  echo  ("<b>red" . ($red) . "</b><br/>");
  73.   //  echo  ("<b>green" . ($green) . "</b><br/>");
  74.   //  echo  ("<b>blue" . ($blue) . "</b><br/>");
  75.  //   echo ("<b>O valor digitado foi: ".$_POST['red']."<br><br>");
  76.  
  77.  
  78.  
  79.  
  80. ?>
  81.  
  82. <br />
  83.  
  84. <b style='color:rgb(<?php echo $red ?>, <?php echo $green ?>, <?php echo $blue ?>);'>o000</b>
  85.  
  86.  
  87.  
  88. </body>
  89. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement