This script:
$dat = fopen("domains.txt", "r");
while (!feof($dat))
{
$read=rtrim(fgets($dat,1024));
if ($read == $url)
{
$rezultat = "false";
echo "Domain $url is free.";
exit;
}
else
{
$rezultat = "true";
echo "Domain $url is not free.";
exit;
}}
should read lines from file domains.txt:
domain.org
domain-name.org
test.domain.org
The problem here is that the reading script only reads the last line in domains.txt, in this case that is test.domain.org. For domain.org, it says, domain is free.
Where have I missed?