Recreating a script not to use php