My primary concern is validating all the parameters that aren't sent to the script, including the IP address and the referrer. The referrer is easily changed client side, sometimes not sent at all (proxies, web browsers, whatever don't have to send it). Think of it as tainted client supplied data (as if from your form) trust it and act on it about as much as a non required unverifyable field on your form.