程序在require_once之后停止工作

时间:2016-04-22 09:31:26

标签: php curl joomla require-once

我们有一个网站将数据发布到另一个网站,一旦发送数据,我们就会包含一个php文件。在包含php文件之后,var_dump不会返回所需的信息("收到的数据")。我认为它起初可能已经卷曲,但是当我尝试将数据添加到数据库时,它也没有做任何事情。所以到现在为止我认为代码还没有继续。当我回应“收到的数据”时在getData函数之前,如果我将它添加到它不显示的getData函数后面,它将显示echo。

WEBSITE1:               

if(isset($_POST['password'])) {
    $password = sha1($_POST['password']);
}

$post = [
        $password,
];

$ch = curl_init("http://localhost/JoomlaToJoomlaPlugin/WebsiteOne/plugins/system/controlplugin/encrypted.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
}

WEBSITE2:

    function __construct() {
    $items = null;

    if(isset($_POST)) {
        $items = $_POST;
    }

    $this->pass = $items[0];

    if(Encrypted::checkHash()) {
            echo 'received data!';
            Encrypted::getData();
                echo 'THIS DOES NOT DISPLAY!!!!!!!!';
            Encrypted::sendDatabackTest();
    } else {
        echo 'error';
    }
}

private function getData() {
    require_once(JPATH_BASE .DS.'libraries/cms/version/version.php');

    echo JVersion::getShortVersion();

0 个答案:

没有答案
相关问题