Source of: /ADI/auth-db-sessions/message_smarty.php

<?php

session_start
();

// put full path to Smarty.class.php
require_once('/usr/share/php/smarty/libs/Smarty.class.php');
$smarty = new Smarty();

$smarty->template_dir = 'templates';
$smarty->compile_dir = 'templates_c';
unset(
$_SESSION['message']);
if (
$_SESSION['message_type'] == 1 ) {   
  
$message="<p><strong>User registration successful!</strong></p>";
      
$message=$message . "<p>Your userid '" . $_SESSION['uid'] . "' and password '". $_SESSION['password'] ."' have been emailed to the email address";
      
$message=$message . "  you just provided in your registration form.
     <br />
     If you are not redirected to the Login page in the next 20 seconds,
     click <a href=\"login_smarty.php\">here</a>.</p>"
;


    
$smarty->assign('message', $message);
      
$smarty->assign('message_type', $_SESSION['message_type']);
}
  


  

if (
$_SESSION['message_type'] == 2 ) {
    
$message="<h1>Thank you for your visit</h1>
               <p>To log in again click <a href=\"login_smarty.php\">here</a>.</p>"
;

    
$smarty->assign('message', $message);
    
$smarty->assign('message_type', $_SESSION['message_type']);
        
session_destroy();

}
 
 
 
// Actualiza o template
 
$smarty->display('message_template.tpl');
 
?>