Update register.php

refactor