But then it isn' right grammar.
Right grammar would be:
You must log in to post a comment or TO register <- what zez meant
You must log in, to post a comment or register <- what zez meant, but this would mean "to post a register":
Example, register replaced with picture, but with same meaning...