i had made a form and one text file is there now i have to enter some value in the form that will match the record in text file and display the record. it shows the record but when i give the else clause where no match found it shows else clause for all the lines it does not matches but and also displays the matched record.
i m giving the code also please any one can rectify
<?php
$fp=fopen("c:\vishal\phpvis\emp.txt","r") or die("could not open file");
while(!feof($fp))
{
$line=fgets($fp,1024);
if (strstr($line,$user))
{
print "$line";
}
else
{
print"sss";
}
}
?>