Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Sending E-mails
Sending email messages is very common for a web
application, for example:
Sending a welcome email when a user create a new account on your
website
Sending newsletters to your registered users
Getting user feedback or comment through the website's contact from
and many more
• $mail->From = 'from@example.com';
• $mail->FromName = 'Mailer';
If message is HTML
• $mail->IsHTML(true); // Set email format to HTML
• $mail->MsgHTML($message);
• $mail->AltBody = 'This is the body in plain text for non-
HTML mail clients';
Adding Attachments
• $mail->AddAttachment('/var/tmp/vcard.info');
$_SESSION['counter']
Session Management (Cont.)
A PHP session can be destroyed by session_destroy() function.
This function does not need any argument and a single call can
destroy all the session variables.
If one want to destroy a single session variable then you can
use unset() function to unset a session variable.
unset($_SESSION['counter']);
session_destroy();
<?php Destroy PHP - Sessions
// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
$_SESSION = array();
session_destroy();
echo "<strong>Step 5 - Destroy This Session </strong><br />";
if($_SESSION['name']){
echo "The session is still active";
} else {
echo "Ok, the session is no longer active! <br />";
echo "<a href=\"page1.php\"><< Go Back Step 1</a>";
}
?>
http://www.cs.kent.edu/~nruan/session_destroy.php