sorry about not having anything done yet, but i'm still confused. how are you using clamshell in your script? you have the values in the database, but why do they need to be sent to the read_user_profile() function?
Well, I am doing a multi-user server with a database. No fileconnections are allowed to exist. All fopens should go out from the script because they are not needed.