This is easily accomplished with server-side scripting. Here is a thread that covered this topic thoroughly:
And here is another thread with some more details:
And here are some references from our documentation that give you a technical basis for the details: