Creating an XML sitemap with PHP

<?php
header("Content-Type: application/xml; charset=utf-8");
$mywebaddress = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
$sitemap = '';

$sitemap .= '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
          http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">';

          $pages = array(
              "index.php"
                );

                //Read each feed's items
                $entries = array();
                foreach($pages as $cat)...

Secure Image Upload Script

<!-- Input -->
<input type="file" name="image" accept="image/x-png,image/gif,image/jpeg" id="file" onchange="return fileValidation()" required>
<!-- Image preview -->
<div  id="imagePreview"></div>

<!-- Script -->
<script type="text/javascript">
function fileValidation(){
  var fileInput = document.getElementById('file');
  var filePath = fileInput.value;
  var allowedExtensions = /(\.jpg|\.jpeg|\.png|\.gif)$/i;
  //Image extensions
  if(!allowedExtensions.exec(filePath)){
      alert('Please upload file having extensions .jpeg/.jpg/.png/.gif...
WebBeer - Beer & Code | Product Hunt Embed