• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: gethostbyname() Simple IP check validation

gethostbyname() Simple IP check validation 11 years 10 months ago #24070

can someone help me create a simple validation fuction

as the script below

1 Uset type of domain name
2 function check if domain have IP 72.235.38.57
3 if yes - redirect to url

<?php  
$host = ($_POST['host']);
$ip = gethostbyname($host);
// echo $ip;
if (isset($_POST['host']) && $ip=='72.235.38.57')
{
header('Location: http://'.$host.':2082');
}
elseif (isset($_POST['host']) && $ip!='72.235.38.57')
{
echo '<form action="panel.html" method="post">www.<input type="text" name="host" size="40" maxlength="256" value=""><input type="submit" value="go"></form>';
  echo "invalid ip"; 
}
 
 else 
 {
echo '<form action="panel.html" method="post">www.<input type="text" name="host" size="40" maxlength="256" value=""><input type="submit" value="przejdz"></form>';
}
?>
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!