argh this dumb script is pissing me off, im just trying to search a diretory for a file and determine if it exists, but no matter what i put $go as ($go is the filename im searching for) it always says its successful. if anyone could tell me what im doing wrong i would really appreaciate it.
heres my code:
<?
$x="0";
$directory = opendir("files/");
while($filename = readdir($directory))
{
if ($filename="$go.dat") {
$x="1";
break;
}
}
closedir($directory);
if ($x==0) {
echo "not found";
} else if ($x==1) {
echo "success";
}
?>