As I mentioned in the comments, storing the username and password in a cookie is an
EXTREMELY bad idea. This will result in the users' credentials being stolen, and you could end up facing hefty fines for not securing your data properly.
You might be thinking that it's not a big deal if hackers manage to break into your site, since you're not doing anything particularly sensitive. But remember, a lot of users re-use the same password on multiple sites. The password that gets stolen from your site could very easily give the hacker access to the user's email, Facebook, or on-line banking accounts as well.
Troy Hunt has written many useful articles on this subject. They tend to focus on ASP.NET, but the principals apply to any web application. Two examples which apply here are:
How to build (and how not to build) a secure “remember me” feature[
^]
C is for cookie, H is for hacker – understanding HTTP only and Secure cookies[
^]
Since you're new to PHP programming, it would be better to use a pre-built framework to handle the security, leaving you free to concentrate on building the interesting bits of your site. A quick Google search brings up
this open-source library[
^], which seems to tick all of the right boxes.