Hello, I am making a personal message system for my site. I have the send and inbox done. But on viewmessage.php other users can view PM’s that aren’t theirs. I was wondering how I could limit these PM’s to only the sender/receiver. I have two fields in my messages table named user_to and user_from. I want to limit it so only the two users in that PM field can view the message I have tried but I can never seem to get it to work.
Nobody?
easy to solve.
to fetch all the message you sun a query to get the messages from the database.
now what u need to do is simply add a WHERE clause to your query = username
Exactly, problem is I cannot do this successfully. I tried redirecting the user if the PM is not sent to them. But instead of redirecting that user it redirects all users who try.
where do u want to redirect users if not sent?
Nevermind it seems I have fixed it somehow 
wordd
haha glad you solved it mark thread solved XD