I had problems with using a function in my cron job, too. You need to pass any variables it is going to need and you need to globalize everything also. And, any functions you want it to use, you need to make sure to include them in the functions. You have to treat the function like it lives in it's own little world and knows nothing of the outside world except what you pass it.
|