As CC said, you're going to have to provide some more details, but right off I see you're using both $profileinfo[8] and $user_profile[8] to check the status field, which may be causing you problems. Also, did you remember to chomp the value you're checking on?
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.