Hi All I have fixed my parse error thanks Tihan, the script validates true on every user, whether they have a username and password in the text file or not. I thought the while(!feof($filehandle)) would read each row of the text file then using this line of code if(preg_match("/$student_name/", $student_name)&&(preg_match("/$student_id/", $student_id))) would try and match against the text file if no match, then execute the Else statement, this is not happening. Can someone help me with making this work please. Cheers Mark
change: if(preg_match("/$student_name/", $student_name)&&(preg_match("/$student_id/", $student_id))) to if(preg_match("/([a-zA-Z-- ]+)/", $student_name)&&(preg_match("/([0-9]+)/", $student_id))) or something..