let alles1 = await $.ajax({
url: `https://api.vk.com/method/friends.get?count=${$count}&offset=${$offset}&fields=${$fields}&access_token=${$token}&v=5.103`,
type: 'GET',
dataType: 'jsonp',
crossDomain: true,
success: async (data) => {
return await data
}
})
let alles2 = await $.ajax({
url: `https://api.vk.com/method/friends.get?count=${$count}&offset=${$offset2}&fields=${$fields}&access_token=${$token}&v=5.103`,
type: 'GET',
dataType: 'jsonp',
crossDomain: true,
success: async (data) => {
return await data
}
})
const alles = alles1.response.items.concat(alles2.response.items)
console.log(alles)
function curl_get($url, $referer = 'www.google.com') {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36");
curl_setopt($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
$body = iconv('windows-1251', 'UTF-8', $data);
return $body;
}
$html = curl_get('https://www.potehechas.ru/club/fact_1.shtml');
echo $html;
<?php // on love
require_once 'mysql_connect.php';
$sql = 'SELECT * FROM `articles` ORDER BY `date` DESC';
$query = $pdo->query($sql);
while($row = $query->fetch(PDO::FETCH_OBJ)) {
if($_POST['username'] != '' && $_POST['mess'] != '') {
header("Location: /news.php?id=$row->id");
}
}
?>