Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head><title>Random Quote</title></head>
  4. <body>
  5. <h1>Random John Muir Quote Page</h1>
  6. <?php
  7. function getQuote($r_num) {
  8. $quotes = array();
  9. $quotes[0] = "The mountains are calling and I must go!";
  10. $quotes[1] = "Between every two pines is a doorway to a new world!";
  11. $quotes[2] = "The power of imagination makes us infinite!";
  12. $quotes[3] = "In every walk with nature, one receives far more than he seeks!";
  13. $quotes[4] = "Climb a mountain or spend a week in the woods, washing your spirit clean!";
  14. $quotes[5] = "Of all the paths you take in life, make sure a few of them are dirt! ";
  15. $quotes[6] = "Into the forest I go, to lose my mind and my soul!";
  16. $quotes[7] = "Nothing truly wild is unclean!";
  17. return $quotes[$r_num];
  18. }
  19. echo "Quote of the day!<br/><br/>";
  20. $randomNumber = rand(0,7);
  21. $randomQuote = getQuote($randomNumber);
  22. echo "<h2>$randomQuote ~John Muir</h2>";
  23. echo "<br/><br/><hr/>";
  24. echo "<h2>The current date is " . date('l F jS, Y');
  25. $month = date("m");
  26. $day = date("d");
  27. $year = date("Y");
  28. $now = mktime(0,0,0,$month,$day,$year);
  29. $then = mktime(0,0,0,04,21,2020);
  30. $gap = $then - $now;
  31. $gap = round($gap/(60*60*24));
  32. echo " Come celebrate Earth Day with us on John Muir's birthday <br/>";
  33. echo "April 21st - <strong>$gap</strong> days from today! </h2>";
  34.  
  35.  
  36.  
  37. ?>
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement