using a script

using a script

How can i make my form so when either someone loads the form or if they submit in it. That will will check all the entires to see if any are a week old, and if they are to remove them? And could someone show me how to do it?

Thanks!