小编M.J*_*M.J的帖子

如何在 PHP 中实现数字签名

我必须在我们用 PHP 打印为 PDF 的证书中实现数字签名。

该要求类似于注册商或副注册商等授权人对证书进行数字签名。实现数字签名背后的基本思想是要知道:

1) 证书是由被授权人数字签名的,是被授权人还是其他没有权限的人创建的。

2) 注册商/副注册商对证书进行数字签名后证书是否有任何变化(防止伪造)。

3) 文件何时签署或更改何时完成。

我在这个主题上搜索了很多东西,却一无所获,甚至没有任何可以指导我如何做到这一点的教程。我以前从未听说过这个,但根据要求我必须这样做。所以请有人指导我或帮助我如何在 PHP 中实现它。我必须在其中实施的证书是http://crsdemo.lsipl.com/crs/web/index.php/auth/birthCertificate/view/cert/B/NzU2MjQ%3D

php digital-signature

6
推荐指数
1
解决办法
2万
查看次数

如何在 Symfony 1.4 的成功页面中获取数据数组

我正在从 Symfony 1.4 的数据库中获取数据。

问题是我无法使用foreach循环和print_r().

错误是

警告:为 foreach() 提供的参数无效。

但是当我在执行查询后在 Action 页面中做同样的事情时,我能够使用foreach()and获取数据print_r($result)

为什么我无法在成功页面中获得该数组?

我使用的查询和循环如下:

$birthSearchQuery = Doctrine_Query::create()->select('a.bir_le_reg,a.bir_le_dob,b.bir_le_district')
            ->from('BirthLegalInfo as a')
            ->innerJoin('a.BirthStatisticalInfo as b')
            ->Where('bir_le_reg_no IS NOT NULL')
            ->andwhere('bir_le_birth_state =' . $birthState)
            ->andwhere('bir_le_birth_district =' . $birthDistrict)
            ->andwhere('YEAR(bir_le_dob)=' .$birthFromYear);

      $result = $birthSearchQuery->execute(array(), Doctrine::HYDRATE_SCALAR);
Run Code Online (Sandbox Code Playgroud)

它使用print_r($result)这样的方式返回给我一组数组

Array
    (
 [0] => Array
    (
        [bir_le_reg] => Delhi
        [bir_le_district] => Delhi
        [bir_le_dob] => 2015
    )

[1] => Array
    (
        [bir_le_reg] => Delhi
        [bir_le_district] => Delhi
        [bir_le_dob] => …
Run Code Online (Sandbox Code Playgroud)

php arrays foreach symfony-1.4

5
推荐指数
1
解决办法
1399
查看次数

Mongodb无法在Ubuntu 15.04中启动

我使用以下命令在Ubuntu 15.04中安装了MongoDB 3.0.6.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
Run Code Online (Sandbox Code Playgroud)

在安装过程的最后,我得到了这个:

Job for mongod.service failed. See "systemctl status mongod.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up mongodb-org-mongos (3.0.6) ...
Setting up mongodb-org-tools (3.0.6) ...
dpkg: dependency problems prevent configuration of mongodb-org:
mongodb-org …
Run Code Online (Sandbox Code Playgroud)

ubuntu mongodb

5
推荐指数
2
解决办法
2万
查看次数

使用 GroupBy 计数在 Laravel 中不起作用

我想要用户和群组之间的聊天计数,按他们的聊天 ID。但是查询没有给出聊天数。它的空白。我在 Stack Overflow(Laravel Eloquent groupBy() AND countLaravel 基于 groupBy 获取结果计数)中看到了类似的问题,并使用了那些标记为正确但仍未获得所需结果的查询。

我正在使用以下查询:

$user_info = DB::table('chat_messages')
                ->select(DB::raw('count(*) as total'))
                ->where('viewed','=', '0')
                ->groupBy('chat_id','type')
                ->get();
Run Code Online (Sandbox Code Playgroud)

我的表结构如下:

{
"_id": ObjectId("571f549b1c8cb6972c8b4567"),
"message": "Testing Chat Functionality",
"type": "singlechat",
"date": "2016-04-26 11:44:27",
"from": "56b07a5a083f119a0b8b4569",
"to": "56b07a5a083f119a0b8b4569",
"chat_id": "56f65fc51c8cb6ca1a8b4567",
"status": "1",
"updated_at": ISODate("2016-04-26T11:44:27.624Z"),
"created_at": ISODate("2016-04-26T11:44:27.624Z"),
"viewed": "0"
}
Run Code Online (Sandbox Code Playgroud)

结果是这样的:

Array
(
[0] => Array
    (
        [_id] => Array
            (
                [chat_id] => 56f65fc51c8cb6ca1a8b4567
                [type] => singlechat
            )

        [chat_id] => 56f65fc51c8cb6ca1a8b4567
        [type] => singlechat
        [count(*) …
Run Code Online (Sandbox Code Playgroud)

php mysql laravel-5

5
推荐指数
1
解决办法
727
查看次数