Success message


/ Published in: PHP
Save to your folder(s)

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

Needs session_start()


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.