Okay it may be offline so try pastebin.com
I think you will need to show that piece of code just to see if it can be replaced with a bit of cURLy coding.
Otherwise you will need a psychic PHP guru, and they are thin on the ground this week.
Opinions are my own views, not DreamHosts'.
I am NOT a DreamHost employee OK! :@
Act on my advice at your own risk!