$params = [
':id' => '',
':name' => $data['name'],
':sname' => $data['sname'],
':email' => $data['email'],
':password' => password_hash($data['password'], PASSWORD_DEFAULT),
':datetime' => date("Y-m-d H:i:s",time()),
':confirm' => 0,
':avatar' => $Avatar,
':detect' => $detect,
':wallpaper' => $wallpaper,
':detectp' => 3,
':activation' => $activation,
':country' => $data['country_id'],
':about' => $data['about'],
':birthday' => $data['birthday_year'].'-'.$data['birthday_month'].'-'.$data['birthday_day'],
':sex' => $data['select'],
':ref' => $ref
];
$.ajax({
type:'POST',
url: 'https://cors-anywhere.herokuapp.com/http://************.ru/api/',
data: {
query: '{"ask":"'+message+'","userid":'+id+',"key":"1"}'
},
success: function(data){
msg = JSON.parse(data);
$(".messages").append('<li><div class="text-msg receive_msg">'+msg['aiml']+'</div></li>');
while($(".messages li").length > 7){
$('li:first').detach();
}
}
});
Пролазил пол дня на форумах - написал mailer php такой
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>