This could be due to several reasons:
- There is no $_COOKIE['usernamecookie']. Check to make sure that exists. If there is a cookie set, its possible that its your server, you could try $HTTP_COOKIE_VARS['usernamecookie'].
- Information is in a session, not a cookie. Try $_SESSION if this is the case.
- The $_COOKIE['usernamecookie'] != "" is not nessessary. Use if (!$_COOKIE['usernamecookie']) instead.
- There is no } at the end of your else statement.
Hope this helps you a bit.
Also, why do you have a closed bracket at the top, before the <?php?