$('video').on('volumechange', function() {
console.log('volume has changed');
})
var $video = $('video'), $btn = $('.btn');
$btn.on('click', toggleMuteState);
$video.on('volumechange', toggleButtonClasses);
$video.prop('muted', false);
function toggleMuteState() {
$video.prop('muted', !$video.prop('muted'));
}
function toggleButtonClasses() {
$btn.toggleClass('mute unmute');
}
<?php
/* attributes check */
if (!isset($_POST['some_attribute']) || empty($_POST['some_other_attribute'])) {
echo 'false';
exit();
}
/* attributes bindings */
$some_attribute = htmlspecialchars($_POST['some_attribute']);
$some_other_attribute = htmlspecialchars($_POST['some_other_attribute']);
/* quality attribute check */
if (strlen($some_attribute) > 10 || strlen($some_other_attribute) > 120) {
echo 'false';
exit();
}
$email = 'test@test.com'
$title = '=?utf8?b?' . base64_encode('some title') . '?=';
$ip = $_SERVER["REMOTE_ADDR"];
/* some hoster (and some php versions) may support date or current_time */
$date = date('d.m.Y H:i:s');
//$date = current_time('d.m.Y H:i:s', 0);
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From: from somewhere <'.$email.'>' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
$html = '<p>Hello! It is a sample email, enjoy!</p>';
if(mail($email, $title, $html, $headers)) {
echo 'true';
} else {
echo 'false';
}