I have no exact way to do this, as I've never done but that is how you could do it. All you gotta do, is to learn some basic Meterpreter scripting, and some very basic PHP so you understand how it functions.