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:
You must log in, to post a comment or a picture
You must log in, to post a comment, or register <- what Mave meant
This is really interesting, you can make a big discussion about it.