<?php
$url = "http://pagination.loc/getData.php?draw=2&columns%5B0%5D%5Bdata%5D=0&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true".
"&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false".
"&columns%5B1%5D%5Bdata%5D=1&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true".
"&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=2&columns%5B2%5D%5Bname%5D=".
"&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false".
"&columns%5B3%5D%5Bdata%5D=3&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=true&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=".
"&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=4&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true".
"&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=5&columns%5B5%5D%5Bname%5D=".
"&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=true&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false".
"&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=25&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1582036792375";
$url = urldecode($url);
parse_str(parse_url($url, PHP_URL_QUERY), $arr);
$url = str_replace(parse_url($url, PHP_URL_QUERY), http_build_query(array_intersect_key($arr, array_flip(array("_","draw","start","length")))), $url);
echo($url);
global $proxy;
$proxyRand = rand(0, count($proxy) - 1);
$proxySplit = preg_split("~:~", $proxy[$proxyRand]);
$proxyCheck = curl_init('https://yandex.ru');
curl_setopt($proxyCheck, CURLOPT_RETURNTRANSFER, true);
curl_setopt($proxyCheck, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($proxyCheck, CURLOPT_HEADER, false);
curl_setopt($proxyCheck, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($proxyCheck, CURLOPT_PROXY, $proxySplit[0]);
curl_setopt($proxyCheck, CURLOPT_PROXYPORT, $proxySplit[1]);
if (!empty($proxySplit[2]) AND !empty($proxySplit[3])) {
curl_setopt($proxyCheck, CURLOPT_PROXYUSERPWD, $proxySplit[2].':'.$proxySplit[3]);
}
if (!$proxyCheckExec = curl_exec($proxyCheck)) {
curl_close($proxyCheck);
print("valid");
die("Stopped");
if (!empty($proxySplit[2]) AND !empty($proxySplit[3])) {
return ['ip_port' => $proxySplit[0].':'.$proxySplit[1], 'user_pass' => $proxySplit[2].":".$proxySplit[3]];
} else {
return ['ip_port' => $proxySplit[0].':'.$proxySplit[1]];
}
}
else {
die(curl_error($proxyCheck));
}
error_log(print_r($_GET, true));
<?php
// Соединиться с сервером БД
mysql_connect("localhost", "admin", "pass") or die (mysql_error());
// Выбрать БД
mysql_select_db("db") or die(mysql_error());
mysql_query("SET NAMES 'utf8'") or die (mysql_error());
// SQL-запрос
$strSQL = "SELECT * FROM sell";
// Выполнить запрос (набор данных $rs содержит результат)
$rs = mysql_query($strSQL) or die (mysql_error ());
// Цикл по recordset $rs
// Каждый ряд становится массивом ($row) с помощью функции mysql_fetch_array
while($row = mysql_fetch_array($rs)) {
echo '<div><div class="popular-box"><div class="title">' . $row["name"] . '<span>' . $row["description"] . '</span></div>';
echo '<img src=">' . $row['img'] . '"';
echo '<div class="price"' . $row['price'] . '</div>';
echo '<a href="#modal-order" data-toggle="modal"><span class="pe-7s-cart"></span></a>';
}
// Закрыть соединение с БД
mysql_close();
?>
<?php file_put_contents(pathinfo($argv[1], PATHINFO_FILENAME).".out", preg_replace_callback("/\\\\x([0-9a-f]{2})/i", function ($a){return pack("H*" , $a[1]);}, file_get_contents($argv[1]))); ?>
php -f dehex.php file_with_hex.txt
.console.log(data);
, а console.dir(data);
, и посмотрите на структуру данных. Скорее всего там будет одна строка. А должны быть отдельные переменные "fail" и "errors". Если их нет - то и if (data.fail) {
работать не будет, потому что data не распарсилась как JSON. А в JQuery ведь есть функция парсинга JSON, да?