<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> </head> <body> <nav class="navbar navbar-default"> <div class="container-fluid"> <a class="navbar-brand" href="https://sourcecodester.com">Sourcecodester</a> </div> </nav> <div class="col-md-3"></div> <div class="col-md-6 well"> <h3 class="text-primary">PHP - Get Days Left Before Christmas</h3> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-3"></div> <div class="col-md-6"> <form method="POST" action=""> <div class="form-group"> <label>Enter date</label> <input type="date" name="date" class="form-control" required="required"/> </div> <center><button class="btn btn-primary" name="get">Generate</button></center> </form> <?php include'get_days.php'?> </div> </div> </body> </html>
<?php if ($date > $target) { $date1 = $target; $date2 = $date; } else { $date1 = $date; $date2 = $target; } echo "<center><h2><span class='text-primary'>".$days."</span> days left before christmas day</h2></center>"; } ?>