<?php
require "database/connect.php";

   $red_id = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

   $url = $red_id;

   $ref_details = parse_url($url, PHP_URL_QUERY);

   if(empty($ref_details)) {
     echo "<script>
       window.location.href = '$website_url';
     </script>";
   }else {
     echo "<script>
       window.location.href = '$website_url/root/register.php?referral=$ref_details';
     </script>";

       }

?>
