rezamalik15

PHP HTML - Light Color Detector

Jun 10th, 2023
1,252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. $light = "blue";
  4.  
  5. ?>
  6.  
  7. <html lang="en">
  8. <head>
  9.     <title>Light Color Detector</title>
  10.     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
  11. </head>
  12. <body>
  13.  
  14. <div class="container">
  15.    
  16.     <h1>Light Color Detector</h1>
  17.  
  18.     <?php if($light == "red"):?>
  19.  
  20.         <h2 class="text-danger">
  21.             <?= "Light color is red"; ?>
  22.         </h2>
  23.    
  24.     <?php elseif($light == "green"):?>
  25.  
  26.         <h2 class="text-success">
  27.             <?= "Light color is green"; ?>
  28.         </h2>
  29.  
  30.     <?php elseif($light == "blue"):?>
  31.  
  32.         <h2 class="text-primary">
  33.             <?= "Light color is blue"; ?>
  34.         </h2>
  35.  
  36.     <?php else:?>
  37.  
  38.         <h2 class="text-secondary">
  39.             <?= "Light color is not detected"; ?>
  40.         </h2>
  41.  
  42.     <?php endif;?>
  43.  
  44. </div>
  45.  
  46. <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment