Jump to content

private message system


magcr23

Recommended Posts

Hi guys, as everybody know, in any message system we can delete the message, but i don't want do delete, i want to hide it from the users.

 

An example of what i want:

miguel sent a message to admin

after admin read it appears for both users the link"delete", but it will only hide the message from the user who pressed the link, the other one will be able to see the message whenever he want.

 

I have this data base: id, from, to, subject, message, date, raiz, read, visible

 

and this code:

  • to show the button:
while($ln = mysqli_fetch_assoc($result)){
 if($ln['raiz'] == 0 && $ln['visible'] == 1){
  echo '<a href="mostraMSG.php?message='.$ln['id'].'"><h2>'.$ln['subject'].'</a><small> para: '. $ln['to'] .'</small></h2>';

  if($ln['read'] == 1){
   echo '<a href="esconder.php?delete='.$ln['id'].'">apagar</a>';
  }
 }					
}
  • to hide the message:
$update = "UPDATE `messages` SET `visible` = 0 WHERE `id` = '$esconder'";
mysqli_query($con, $update);

The problem is if i do this update, it will hide for both of them,

How can i make it hide for the one who pressed the link?

Link to comment
https://forums.phpfreaks.com/topic/297042-private-message-system/
Share on other sites

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.