"body" => json_encode(array('$filter' => '1 eq 1','text' => 'Test notification for all subscribers'))) );
<?php
$name = trim(stripslashes($_POST['name']));
$from = trim(stripslashes($_POST['email']));
$form_message = trim(stripslashes($_POST['message']));
$subject = "Тема письма";
$to = 'daniel.k07@yandex.ru';//replace with your email
$message = "Имя: $name <br> Сообщение: $form_message";
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/html; charset=iso-8859-1";
$headers[] = "From: {$name} <{$from}>";
$headers[] = "Reply-To: <{$from}>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
mail($to, $subject, $message, implode("\r\n", $headers));
die;
// Contact form
var form = $('#main-contact-form');
form.submit(function(event){
event.preventDefault();
var form_status = $('<div class="form_status"></div>');
$.ajax({
url: $(this).attr('action'),
dataType: 'json',
method: "POST",
data: {
message : form.children('input[name="message"]').val(),
name: form.children('input[name="name"]').val(),
email: form.children('input[name="email"]').val()
},
beforeSend: function(){
form.prepend( form_status.html('<p><i class="fa fa-spinner fa-spin"></i> Email is sending...</p>').fadeIn() );
}
}).done(function(data){
form_status.html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut();
});
});
function readTextFile(file, callback) {
var rawFile = new XMLHttpRequest();
rawFile.overrideMimeType("application/json");
rawFile.open("GET", file, true);
rawFile.onreadystatechange = function() {
if (rawFile.readyState === 4 && rawFile.status == "200") {
callback(rawFile.responseText);
}
}
rawFile.send(null);
}
//использование:
readTextFile("/Users/Documents/workspace/test.json", function(text){
var data = JSON.parse(text);
console.log(data);
});
grouped_options = [
['Group 1',
["Item 1", "Item 2", "Item 3"]],
['Group 2',
["Item 1", "Item 2", "Item 3", "Item 4"]]
]
grouped_options_for_select(grouped_options)
$i = -1;
foreach ($owned_urls as $k => $v) {
$pos = strpos($v, $string);
if ($pos > 0) $i = $k;
}
if ($i > 0) {
//значение найдено в ячейке, номер которой содержится в $i
} else {
//значение не найдено
}
$str = implode(",", $owned_urls);
$pos = strpos($str, $string);
if ($pos > 0) {
//значение найдено
} else {
//значение не найдено
}
SELECT * FROM nametable WHERE IsNull(col1,'') like '%"+ui->text_pole_1->text()+"%' ;
SELECT * FROM nametable WHERE IfNull(col1,'') like '%"+ui->text_pole_1->text()+"%' ;
SELECT * FROM nametable WHERE coalesce(col1,'') like '%"+ui->text_pole_1->text()+"%' ;
SELECT * FROM nametable WHERE nvl(col1,'') like '%"+ui->text_pole_1->text()+"%' ;