PHP gateway enhanced