search

Home  >  Q&A  >  body text

file_get_contents carries cookies to obtain data and deploys it to the server, which fails.

$url = 'https://www.ssldun.cn/clientarea.php?action=productdetails&id=2&modop=custom&a=DownloadCert';$con = 'WHMCSy551iLvnhYt7=382h2f4u8eo25oiovc9p2ffsu3';$rand = rand(10000,99999) ;//Random number $filename= time().$rand.'.zip';//Send a request to get the name of the compressed package. Need to delete//Send a request with cookie to get the contents of the compressed package. $opts = array('http' => array('header'=> 'Cookie:'.@$con.''));$context = stream_context_create($opts);$contents = file_get_contents($url, false, $context);var_dump( $contents);

That is, when this code is deployed on the server, the file cannot be obtained

夜幕夜幕1336 days ago876

reply all(1)I'll reply

  • ?小虾米

    ?小虾米2021-06-09 20:03:00

    What is the return result? Is there any error message?

    reply
    0
  • Cancelreply