Update index.php

Structure of if statement fixed
NEVER echo cwd
not sure if this is what you wanted to achieve but give it a go