This should help you out. PHP 3/4 should have yp enabled in order to use the yp functions. Just supply the user's logon id, and password (from a form or other function...) and the function will verify the user and password against the NIS.
Function verifyPassword ($user_id, $user_password)
{...