so, your sql statement should be comparing the user sumbitted via the link (via cookie login info stored?) to the original destination user id of the Message...
the if statement uses that condtional for it's evaluation
PHP Code:
$sql statement
if row('newuser') = row('originaluser') {
build out the reply page you could include the orginal sql in here to build out the reply page. or modify the sql to ensure its got the right user in here.
}
else
{
$error = "you arent allowed to see this post. admin notified.";
// email admin account
email_error($row('newuser'),(timestamp), (ip), ... <whatever information you can get from the browser>)
// display the login page with message above.
rebuild_login_page($error);
}
Does the database keep user information for the PM's? meaning you have two tables your comparing
1 user
2 pm's
the user table obviously has user accounts, but does the PM's table? if it does, do a join based off the pm message id orginal user and the account of the poster, if they match build if not... admin email.
Bookmarks