App server side PHP code