Sunday, May 28, 2023

colourful pyramid using PHP

 

colourful pyramid using PHP



<!DOCTYPE html>
<html lang="en">
<head>
  <title>Colorfull Pyramid</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,
initial-scale=1">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/
dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/
dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container">
   <div class="row">
    <div class="col-md-12 h4">
<?php

for($i=0; $i<=9; $i++){
   
     for($j=$i; $j<9; $j++){
       
        echo "&nbsp;";        
     }
     
     for($k=1; $k<$i; $k++) {
        echo "<span class='jump-response'> * </span>";
     }
           
   
    echo "<br/>";
}
?>
    </div>
  </div>

</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/
3.6.4/jquery.min.js"></script>

<script>
    $(function() {
    $(".jump-response").each(function() {
        var hue = 'rgb(' + (Math.floor((256-100)*
Math.random()) + 150) + ',' + (Math.floor((256-100)*
Math.random()) + 50) + ',' + (Math.floor((256-100)*
Math.random()) + 50) + ')';
         $(this).css("color", hue);
    });
});
</script>
</body>
</html>




Saturday, May 27, 2023

How do you use Laravel 10 to redirect all requests to the public/ folder?

 

How do you use Laravel 10 to redirect all requests to the public/ folder?

How do you use Laravel 10 to redirect all requests to the public/ folder?

 Using .htaccess with mod_rewrite


<IfModule mod_rewrite.c>

    RewriteEngine on

    RewriteRule ^(.*)$ public/$1 [L]

</IfModule>

Get Month's Name using PHP Logic

 

Month's Name using PHP Logic

Get Month's Name using PHP Logic

<select class="form-control border border-success">
    <option value="">--select month...</option>
    <?php
    $curmonth = date("F");
    for($i = 1 ; $i <= 12; $i++)
    {
    $allmonth = date("F",mktime(0,0,0,$i,1,date("Y")))
    ?>
        <option value="<?php
        echo $i; ?>" <?php
        if($curmonth==$allmonth) echo ' selected';
        ?>>
        <?php
        echo date("F",mktime(0,0,0,$i,1,date("Y")));
        //Close tag inside loop
        ?>
        </option>
        <?php } ?>
</select>

colourful pyramid using PHP

  <! DOCTYPE html > < html lang = "en" > < head >   < title >Colorfull Pyramid</ title >   < me...

Clock