Posted By

Sn0opy on 05/27/08


Tagged

session success


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Sn0opy


Success message


 / Published in: PHP
 

It will show a saved success message. Usefull for forms to show people a success message after redirecting to another site.

Needs session_start()

  1. function success() {
  2. if(isset($_SESSION['success']) && $_SESSION['success'] != '') {
  3. print('<div id="success">' .$_SESSION['success']. '</div>');
  4. $_SESSION['info'] = '';
  5. }
  6. }
  7.  
  8. function setsuccess($text) {
  9. $_SESSION['success'] = $text;
  10. }

Report this snippet  

You need to login to post a comment.