moved php code to external file