02-05-2016, 03:39 PM
You're going to laugh when I tell you this, but the best way to do this is to let UserSpice do it for you. No coding required. Login as administrator, and go to Admin Pages. Click on register.php and make it private. Then check the box next to administrator and click update. This will allow only users with administrator access to use the register.php page.