- 1
https://www.php.net/manual/en/intro.parallel.php
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
https://www.php.net/manual/en/intro.parallel.php
Покайтесь! Пока вы называли пиздецом пандемию и всё с ней связанное, незаметно подкралось нечто действительно страшное.
+2
function get_page() {
$routes = Utility::get_routes('', 'admin/*', '[0-9a-z\.\/\-]*');
$entities = [];
foreach ($routes as $key => $value) {
$entities[$value['entity_type']][$value['entity']][] = $value;
}
$map = [
'core' => Utility::get_string('Ядро'),
'base' => Utility::get_string('Базовое'),
'custom' => Utility::get_string('Пользовательское')
];
$menu = [];
if ($entities) {
$entities = [
'core' => $entities['core'] ?? [],
'base' => $entities['base'] ?? [],
'custom' => $entities['custom'] ?? []
];
foreach ($entities as $key => $value) {
$count = 0;
foreach ($value as $key2 => $value2) {
$index = $map[$key];
$entity = str_replace('_', ' ', $key2);
$entity_upper = ucfirst($key2);
$title = $route = '';
$on = false;
$items = [];
foreach ($value2 as $key3 => $value3) {
if ((!isset($value3['menu']) || $value3['menu']) && (!isset($value3['type']) || $value3['type'] == 'replace') && (!isset($value3['access']) || (new User)->get_access($value3['access']))) {
$first = count(explode('/', $value3['route'])) <= 2;
if (!$title && $first) {
$title = $value3['title'] ?? $entity_upper;
$route = $value3['route'];
}
$items[$value3['route']] = $value3['title'] ?? $entity_upper;
$on = true;
}
}
if ($on) {
$menu[$index][$key2] = [
'title' => $title ?: $entity_upper,
'title_link' => $route ?: 'admin/'.$entity,
'items' => $items,
'tr' => $count && $count % 3 === 0 ? '</tr><tr>' : '',
];
$count++;
}
}
}
}
return $menu;
}
eqsash-2.0.zip/eqsash-2.0/core/admin/admin.php
>>> Eqsash
>>> Премиум технологии
0
$dump = preg_replace_callback(
'/
(?<utf8>
[\x09\x0A\x0D\x20-\x7E]
| [\xC2-\xDF][\x80-\xBF]
| \xE0[\xA0-\xBF][\x80-\xBF]
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}
| \xED[\x80-\x9F][\x80-\xBF]
| \xF0[\x90-\xBF][\x80-\xBF]{2}
| [\xF1-\xF3][\x80-\xBF]{3}
| \xF4[\x80-\x8F][\x80-\xBF]{2}
)
|
(?<trash>.)
/xs',
function (array $match) {
if (isset($match['utf8']) && strlen($match['utf8']) > 0) {
$char = $match['utf8'];
if (strlen($char) === 1 && ord($char) < 31) {
return '\x' . bin2hex($char);
} else {
return $char;
}
} else {
return '\x' . bin2hex($match['trash']);
}
},
hex2bin('2cd2d948cfaf4b1097530f7c74fb6737')
);
var_dump($dump);
https://phpclub.ru/talk/threads/bytes-fromhex-в-php.86568/
Матёрые пхпшники переводят «Python» на «PHP».
0
<div class="choose_payment">
<div class="title"><span>2</span>Выберите способы оплаты (все без комиссии)</div>
<!-- all terminals -->
<div class="all_terminals">
<!-- fike: конечно же тут были все терминалы, а вы как думали? -->
</div>
<!-- payments. no commisson -->
<div class="no_commission"><label>
<div class="title_no_commission"><i>Подсказка:</i></div>
<div class="we_recommend_2">
<div class="title_we_recommend_2">
Оплачиваете первый раз?<br>
наши специалисты ответят на все вопросы <br>
<!--?phpphp echo preg_replace("/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{2})([0-9]{2})/", "+$1 ($2) $3-$4-$5", SUPPORT_PHONE); ?--> ежедневно с 10:00 до 19:00
</div>
</div>
</label>
</div>
</div>
А впрочем нет, не ответят
+3
<?php
define('BOT_TOKEN', '12345678:replace-me-with-real-token');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function apiRequestWebhook($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
return false;
}
if (!$parameters) {
$parameters = array();
} else if (!is_array($parameters)) {
error_log("Parameters must be an array\n");
return false;
}
$parameters["method"] = $method;
header("Content-Type: application/json");
echo json_encode($parameters);
return true;
}
function exec_curl_request($handle) {
$response = curl_exec($handle);
if ($response === false) {
$errno = curl_errno($handle);
$error = curl_error($handle);
error_log("Curl returned error $errno: $error\n");
curl_close($handle);
return false;
}
$http_code = intval(curl_getinfo($handle, CURLINFO_HTTP_CODE));
curl_close($handle);
if ($http_code >= 500) {
// do not wat to DDOS server if something goes wrong
sleep(10);
return false;
} else if ($http_code != 200) {
$response = json_decode($response, true);
error_log("Request has failed with error {$response['error_code']}: {$response['description']}\n");
if ($http_code == 401) {
throw new Exception('Invalid access token provided');
}
return false;
} else {
$response = json_decode($response, true);
if (isset($response['description'])) {
error_log("Request was successful: {$response['description']}\n");
}
$response = $response['result'];
}
return $response;
}
function apiRequest($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
return false;
}
if (!$parameters) {
$parameters = array();
} else if (!is_array($parameters)) {
error_log("Parameters must be an array\n");
return false;
}
foreach ($parameters as $key => &$val) {
// encoding to JSON array parameters, for example reply_markup
if (!is_numeric($val) && !is_string($val)) {
$val = json_encode($val);
}
}
$url = API_URL.$method.'?'.http_build_query($parameters);
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($handle, CURLOPT_TIMEOUT, 60);
return exec_curl_request($handle);
}
function apiRequestJson($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
return false;
}
if (!$parameters) {
$parameters = array();
} else if (!is_array($parameters)) {
error_log("Parameters must be an array\n");
+2
Оффтоп словаря терминов говнокода.
Для всего, что хотели ответить на комментарий из http://govnokod.ru/26478.
Поддержим чистоту расы словаря!
−1
<form>
<link rel="stylesheet" href="css4.css">
<div class="four"><h1 align="center"><b>Выберите что будете накручивать:</b></h1></div><br>
<center><input class="fti" type="radio" name="message" value="Подписчики" id="marg2" required><b>Подписчики(1000шт. - 200₽)</b><br></center>
<center><input class="fti" type="radio" name="message" value="Лайки" id="marg2" required><b>Лайки(1000шт. - 200₽)</b><br></center>
<center>Укажите количество:</center>
<center><input type="number" name="count" class="iinput" value="1" id="a" name="count" min="10" max="10000" required oninput="b.value=(this.value*.2).toFixed(2)"> шт.<br></center>
<center>Укажите ссылку:</center>
<center><input type="url" name="url" class="iinput" placeholder="www.instagram.com/example/" id="marg" required><br></center>
<center>Укажите ваш Email:</center>
<center><input type="email" name="email" class="iinput" placeholder="[email protected]" id="marg" required><br></center>
<center>Будет списано:</center>
<center><input type="number" id="b" name="out" class="iinput" readonly="readonly">₽</center>
<a href="glavn.html" id="al">На главную</a>
<center><input type="submit" href="glavn.html" id="af" value="Отправить"></div></center><br>
<center><i class="fa fa-info-circle" aria-hidden="true" style="color:#D3D3D3;"><b style="color:#D3D3D3;">ЗАКАЗ ПРИДЁТ В ТЕЧЕНИИ 24 ЧАСОВ</b></i></center>
</form>
<?
Давайте течь от «PHPClub».
https://phpclub.ru/talk/threads/Помогите-с-отправкой-формы-на-email.86557/
>>> Я не могу отправлять данные с форм на сайте на свою почту.Я пробовал много способов но у меня не получалось.Буду благодарен за помощь в создании кода php.
>>> Выберите что будете накручивать
+1
/index.php/module/action/param1/${@die(md5(HelloThinkPHP))}: 1 Time(s)
/index.php?s=%2f%69%6e%64%65%78%2f%5c%74%6 ... %6e%6b%50%48%50: 1 Time(s)
/index.php?s=/module/action/param1/${@die( ... elloThinkPHP))}: 1 Time(s)
такую вот хуйню в логах вижу
пыха у меня разумеется никакого нет, но что это вообще такое? Что так ломают?
+3
<?php
var lastmsgid=$('.chat-msg:eq(0)',$(this).parent()).data('messageid');
var lastmsg=$('#chat .chat-msg[data-messageid='+lastmsgid+']');
var lastmsgscroll=lastmsg.offset().top;
var lastscroll=$('#chat .messages').scrollTop();
$(this).attr('disabled','disabled');var button=$(this);$.ajax({
url: '<?=$baseHref;?>chat.php?more=1&user=<?=(int)$_GET['user'];?>&last=<?=(int)$last;?>',
success: function(data) {
if(data!='err'){
data=JSON.parse(data);
button.parent().prepend(data.messages);button.remove();fixdates();
/*smiles*/$('#chat .messages .chat-msg div:not(.smilesadded)').each(function(){$(this).addClass('smilesadded').html(replacesmiles($(this).html()));});
if($('#chat .messages').scrollTop()==0)$('#chat .messages').scrollTop(lastscroll-lastmsgscroll+lastmsg.offset().top);//prepend и так это делает. но не всегда
} else {alert('Error');button.removeAttr('disabled');}
},
error: function(xhr, str){
alert('Error: ' + xhr.responseCode);
button.removeAttr('disabled');
}
});" class="btn-more button" style="margin-top:20px;margin-bottom:20px;"><?_e('Загрузить ещё');?></button><?}
if(!isset($_GET['checknew']))$messages=array_reverse($messages);
$user=mysqli_fetch_assoc(mysqli_query($mysqli,"SELECT * FROM users WHERE `id`=".(int)$_GET['user']." LIMIT 1;"));
foreach($messages as $data){
if($yourdirection==$data['direction'])$userid=$account['id']; else $userid=(int)$_GET['user'];
$fake=0;
if(substr($data['text'],0,7)==':attach' && substr($data['text'],-1)==':'){$data['attachment']='../no-attach-premium.png?';if($premium)$data['attachment']=substr($data['text'],7,-1);$data['text']='';$fake=1;}
?>
И сказал Господь: сойдем же и смешаем языки их, чтобы один не понимал речи другого.
+1
<?php
class Pet {
protected $name;
public function __construct($name) {
echo "Setting name to " . $name . "\n";
$this->name = $name;
}
public function eat() {
echo $this->name . " is eating.\n";
}
}
$var = 30;
$a_pet = new Pet("Spike");
$a_pet->eat();
?>
---
<?php
function Pet__construct(&$objInst, $name)
{
echo 'Setting name to ' . $name . '
';
$objInst['name'] = $name;
}
function Pet_eat(&$objInst)
{
echo $objInst['name'] . ' is eating.
';
}
$Pet = array('__vars' => array('name' => null));
$var = 30;
$a_pet = array_merge($Pet['__vars'], array('__type' => 'Pet'));
Pet__construct($a_pet, 'Spike');
Pet_eat($a_pet);
Конвертер из ООП в процедурный стиль.
Make PHP great again.
https://github.com/PatrickZurekUIC/PHP-OOP-Converter