I am including a PM system on my site and didn't want to write my own so I found one online, the problem I'm now having is that I need to tell it to pull the messages from the database based on the username save in the session but don't know how. The code below is what was put in the tutorial but it only selects based on the number entered.
// Set the userid to 2 for testing purposes... you should have your own usersystem, so this should contain the userid
// initiate a new pm class
$pm = new cpm($userid);