E' sicuramente piu' flessibile farlo via PHP.