Question : I have it in ASP but I wonder how can I write this in PHP

<%
Function ValidateServer()
      Dim yourHostingDomain
   yourHostingDomain = "www.mydomain.com"

    if instr(request.servervariables("http_referer"), yourHostingDomain) > 0 then
 
    ValidateServer = true
  Else
    ValidateServer = false
    End IF
   
End Function
 
If (ValidateServer) Then
   else
   response.redirect("http://www.mydomain.com")
End IF
%>

Answer : I have it in ASP but I wonder how can I write this in PHP

<?php
$validateServer=false;
function validateServer()
{
      global $validateServer;
      $yourHostingDomain = "www.mydomain.org";

      if(strstr($_SERVER["HTTP_REFERER"], $yourHostingDomain) )
            $validateServer = true;
      else
            $validateServer = false;
}

validateServer();
if($validateServer)
{}
else
{
      header("Location: http://www.mydomain.com");
}
?>
Random Solutions  
 
programming4us programming4us