Redirect users to different page after a login failure in d7
Please try with the correct form_id for user login.

i.e: if ($form_id == 'user_login') {

The form_id can be found in the HTML source hidden element

&lt;input type="hidden" name="form_id" id="edit-user-login" value="user_login"&gt;