Generalise the PHP end of the manager ajax page handling