相关疑难解决方法(0)

PHP卷曲和饼干

我在PHP Curl和Cookies身份验证方面遇到了一些问题.

我有一个文件Connector.php,它对另一台服务器上的用户进行身份验证,并返回当前用户的cookie.

问题是我想用curl验证成千上万的用户,但它一次只为一个用户验证和保存COOKIES.

connector.php的代码是这样的:

    <?php
    if(!count($_REQUEST)) {
        die("No Access!");
    }


    //Core Url For Services
    define ('ServiceCore', 'http://example.com/core/');


    //Which Internal Service Should Be Called
    $path = $_GET['service'];


    //Service To Be Queried
    $url = ServiceCore.$path;

    //Open the Curl session
    $session = curl_init($url);

    // If it's a GET, put the GET data in the body
    if ($_GET['service']) {
        //Iterate Over GET Vars
        $postvars = '';
        foreach($_GET as $key=>$val) {
            if($key!='service') {
                $postvars.="$key=$val&";
            }
        }
        curl_setopt ($session, CURLOPT_POST, true);
        curl_setopt ($session, …
Run Code Online (Sandbox Code Playgroud)

php authentication cookies curl

28
推荐指数
4
解决办法
14万
查看次数

file_get_contents()错误

我在PHP上使用file_get_contents,它会抛出一些错误:

我的代码

#try to fetch from remote
$this->remotePath = "http://some-hostname.com/blah/blah.xml
$fileIn = @file_get_contents($this->remotePath);
Run Code Online (Sandbox Code Playgroud)

错误:

Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /virtual/path/to/file/outputFile.php on line 127

Warning: file_get_contents(https://some-host-name/data/inputFile.xml) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /virtual/path/to/file/outputFile.php on line 127
Run Code Online (Sandbox Code Playgroud)

任何的想法?它在我的计算机上工作正常但在我将其移植到Web服务器时停止工作.

php file-get-contents

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

标签 统计

php ×2

authentication ×1

cookies ×1

curl ×1

file-get-contents ×1