$('.name').text();
$.ajax({
url: "http://artultra/save.php",
type:"post",
async: false,
data: { screen : i },
proccessData: false,
success: function(response){
alert('ok')
},
error:function(xhr, ajaxOptions, thrownError){
alert(xhr.responseText);
}
});
function sendPhoto($chat_id) {
$url = $GLOBALS['api']."/sendPhoto?chat_id=".$chat_id ;
file_put_contents('image.jpg', file_get_contents('https://unsplash.it/600/600/?random'));
$post_fields = array(
'chat_id' => $chat_id,
'photo' => new CURLFile(realpath("image.jpg"))
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type:multipart/form-data"
));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
$output = curl_exec($ch);
}
Почитать о jQuery