title: What is the best way to view a successful or a bad message?
body: <p>For a long time, I've been thinking what's best way to display successful or error message. I need to refresh the page and then view the message. If I would use <code>$_GET</code> (for example:<code>/My-Page?status=success</code>), the problem would be that anyone can edit <code>status</code>. It's not a big problem, but I don't know if it's the best idea...</p>
  
  <p>If I use <code>SESSION</code>:</p>
  
  <pre><code>$_SESSION['message'] = "Mail was sent successfully!";
  header('Location: '.$_SERVER['REQUEST_URI']);
  exit();
  
  //and then:
  if (!empty($_SESSION['message'])) {
      echo $_SESSION['message'];
  }
  </code></pre>
  
  <p>I would probably have done what I wanted, but if someone would left and then came back to the page (or just refreshed the page), he will still see a message (and that's not what I want)...</p>
  
  <p>So, to sum up, my question is: What's the best way to save the message to variable to only appear once (after the refresh, the message would disappear) and nobody could edit it? I'm sorry for my English, I hope I wrote it all clearly :-)</p>