You might check script sites for this type of function, like HotScripts.com, etc.
One of the resources on this page may help: phpjunkyard.com/resources.php
Sorry, we do not offer free written scripts on this forum.
We help people implement the scripts they have or suggest some we really like.
There are forums that allow you to post to solicit free and paid scripts to handle functions like the one you need.
Search webmasterworld.com or php forums too.