Keep in mind that most forums forbid you from using automated scripts to visit their site.
I once created a script that did something similar-- with the permission of the website owner --I scraped some information from their member area. They didn't want to create an API for me so I automated the process using a browser emulation class called Snoopy.
Do a google search for: PHP snoopy class
It's the first match in google (at Source Forge). I hope this helps.