Server-side script for PBD