文章詳情頁
file_get_contents攜帶cookie獲取數(shù)據(jù)部署到服務(wù)器失效
瀏覽:175日期:2022-06-02 10:01:56
問題描述
$url = 'https://www.ssldun.cn/clientarea.php?action=productdetails&id=2&modop=custom&a=DownloadCert';$con = 'WHMCSy551iLvnhYt7=382h2f4u8eo25oiovc9p2ffsu3';$rand = rand(10000,99999);//隨機(jī)數(shù)$filename= time().$rand.'.zip';//發(fā)送請求獲取壓縮包名稱 需要刪除//發(fā)送帶有cookie的請求獲取壓縮包內(nèi)容$opts = array('http' => array('header'=> 'Cookie:'.@$con.''));$context = stream_context_create($opts);$contents = file_get_contents($url, false, $context);var_dump($contents);
就是這段代碼部署到服務(wù)器上總是獲取不到文件
問題解答
回答1:返回結(jié)果是什么,有報錯信息嗎
相關(guān)文章:
1. phpstudy8.1沒集成mysql-front2. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””3. node.js - mongodb查找子對象的名稱為某個值的對象的方法4. docker鏡像push報錯5. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題6. javascript - 在 model里定義的 引用表模型時,model為undefined。7. 運行python程序時出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯誤?8. javascript - QQ第三方登錄的問題9. 利用IPMI遠(yuǎn)程安裝centos報錯!10. html5 - datatables 加載不出來數(shù)據(jù)。
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備