<?php
$proxies = file ("1_ne_check.txt");
if (empty($proxies))
{
exit(1);
}
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
$proxies_out = array();
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
unset($proxies[array_search ($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
$proxies5_out = array();
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies5_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
file_put_contents("2_results.txt", implode("\r\n", $proxies_out)."\r\n\r\n".implode("\r\n", $proxies5_out));
?>
<?php
session_start();
require('connect.php');
$fsmsg = "";
if (!empty($_POST['username']) AND !empty($_POST['password'])) {
$username = mysqli_real_escape_string($connection, $_POST['username']);
$password = $_POST['password'];
$query = "SELECT * FROM users WHERE username='{$username}'";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
$row = mysqli_fetch_assoc($result);
if (isset($row['ban']) AND $row['ban'] == 1){
$fsmsg = "Пользователь заблокирован";
}
else if (isset($row['password']) AND $row['password'] == $password) {
$_SESSION['username'] = $username;
$fsmsg = "Вы вошли под пользователем";
if (isset($row['role']) AND $row['role'] == "admin") {
$fsmsg = "Вы вошли под админом";
}
} else {
$fsmsg = "Ошибка";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Авторизация</title>
</head>
<body>
<div class="container">
<?php
if (isset($_SESSION['username'])) {
$username = $_SESSION['username'];
echo("Hello," . $username . ".<br>\n");
if(!empty($fsmsg)) echo("<h2>{$fsmsg}</h2><br>\n");
echo("<a href='logout.php' class='btn btn-lg btn-primary'>Выйти</a>");
}
else
{
?>
<form class="form-signin" method="POST">
<?php if(!empty($fsmsg)) echo("<h2>{$fsmsg}</h2><br>\n"); ?>
<h2>Авторизация</h2>
<input type="text" name="username" class="form-control" placeholder="Username" required>
<input type="password" name="password" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Авторизоваться</button>
<a href="index.php" class="btn btn-lg btn-primary btn-block">Зарегистрироваться</a>
</form>
</div>
<?php
}
?>
</body>
</html>
@echo off
for /f %%i in (devices.txt) do (
echo Fetching data from %%i...
c:\putty\plink.exe -telnet -P 23 -l cisco %%i -pw "P@55W0rD!" -m command.txt -v >>log.txt 2>&1
)
<?php
$proxies = file ("gotovo_vse_sellery_bezdybley.txt");
$proxies_out = array();
$mc = curl_multi_init ();
for ($thread_no = 0; $thread_no<count ($proxies); $thread_no++)
{
$c [$thread_no] = curl_init ();
curl_setopt ($c [$thread_no], CURLOPT_URL, "http://google.com");
curl_setopt ($c [$thread_no], CURLOPT_HEADER, 0);
curl_setopt ($c [$thread_no], CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($c [$thread_no], CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($c [$thread_no], CURLOPT_TIMEOUT, 10);
curl_setopt ($c [$thread_no], CURLOPT_PROXY, trim ($proxies [$thread_no]));
curl_setopt ($c [$thread_no], CURLOPT_PROXYTYPE, 0);
curl_multi_add_handle ($mc, $c [$thread_no]);
}
do {
while (($execrun = curl_multi_exec ($mc, $running)) == CURLM_CALL_MULTI_PERFORM);
if ($execrun != CURLM_OK) break;
while ($done = curl_multi_info_read ($mc))
{
$info = curl_getinfo ($done ['handle']);
if ($info ['http_code'] == 301) {
echo trim ($proxies [array_search ($done['handle'], $c)])."\r\n";
$proxies_out[trim($proxies[array_search($done['handle'], $c)])] = trim($proxies[array_search($done['handle'], $c)]);
}
curl_multi_remove_handle ($mc, $done ['handle']);
}
} while ($running);
curl_multi_close ($mc);
file_put_contents("proxyuniq.txt", implode("\r\n", $proxies_out));
?>
while( ($cat = mysqli_fetch_assoc($result)) )
{
if ($articles_count = mysqli_query($conection, "SELECT * FROM `articles` WHERE `categories_id`='".mysqli_real_escape_string($connection, $cat['id'])."'"))
{
echo '<li>' . $cat['name'] . ' ('. mysqli_num_rows($articles_count).') </li>';
}
}
mysqli_real_escape_string()
). ini_set("post_max_size", "100M");
в самом начале скрипта, который обрабатывает этот AJAX-запрос.