Remove duplicated $_POST['type']

Strangely my text editor also removed some trailing spaces. Nothing harmful.