Rect2XY's php side (not completed)