$check = "SELECT username FROM logintable WHERE username = '$usercheck'";
First error is here. I don't know witch version of PHP you're using, however there is some change since 4.x that does not allow when creating MySQL requests to user variables inside querries. Use it like this:
$check = 'SELECT username FROM logintable WHERE username ="'. $usercheck.';";
It will work like that.
2nd error is that your password, when encrypted, becomes more characters than you have assigned for the table. Run querry in mysql console "describe logintable;" and check for Password column how many chars are assigned. E.g. you should see something like this:
password varchar(45) not null;
If you're using UTF8 as encoding in order to store 45 chars, you should double the number, that is you should make it 90 chars.
Make the changes and advise if solved your problems.