you said this is written in PHP -- if you don't have access to your php.ini file, you can put
error_reporting(0);
at the top of the script to prevent warnings from showing up to the user.