Moving php code to the correct page