文件获取内容php错误

时间:2015-11-30 13:52:10

标签: php html api curl

  

警告:file_get_contents(verdiyev_orxan:ayna12 T.PEMBE_KAPLAN   :05326559389 volkan.n1:suem97 Dilanazaka:dilanaz2008):未能打开   stream:第204行的C:\ xampp \ htdocs \ yni \ ayikla.php中的参数无效   0

<?php
    if (!isset($_POST['submit'])) die();
    include "auth/instagram.auth.class.php";
    include "auth/instagram.class.php";
    include "RollingCurl/RollingCurl.php";

    error_reporting(E_ALL ^ E_NOTICE);
    ini_set("display_errors", 1);
    $extension = ".cookie";


    $dir = "cookies/"; //taranan dosyalar hangi dizine gitsin.
    $data = $_POST['data'];


    $data = file_get_contents($data);
    $users = explode("\n", $data);

    foreach ($users as $user) 
    {
        try 
        {
            $explode = explode(":", $user);
            $username = trim($explode[0]);
            $password = trim($explode[1]);

            $auth = new instaAuth;
            $auth->setCacheFolder($dir);
            $auth->setCacheExtension($extension);

            $login = $auth->_login($username, $password);

            echo $username.' 1'.PHP_EOL;

            sleep(1);

        } 
        catch (Exception $e )
        {
            echo $username.' 0'.PHP_EOL;
            // echo $e->getMessage();
            sleep(1);
        }


    }


    ?>

这里可能有错误

$data = file_get_contents($data);
        $users = explode("\n", $data);

如何解决?

1 个答案:

答案 0 :(得分:1)

在这里改变

$data = $_POST['data'];

$data = file_get_contents($data);
$users = explode("\n", $data);

$data = $_POST['data'];
$users = explode("\n", $data);