I take it you are not doing
if ($user='joe' and $password='smith')
but
if ($user=='joe' and $password=='smith')
and as allways, print, print and print some more.
echo 'Data from form:--'.$form_password."--\n";
$form_password=trim($form_password);
echo 'Trimmed data from form:--'.$form_password."--\n";
echo 'Data ro compare with:--'.$password."--\n";
and so on.
The minus signs let you see spaces etc more easily.