<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Неофициальный форум DLNA Home Media Server &mdash; куки]]></title>
		<link>https://hms.lostcut.net/viewtopic.php?id=819</link>
		<atom:link href="https://hms.lostcut.net/extern.php?action=feed&amp;tid=819&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «куки».]]></description>
		<lastBuildDate>Fri, 02 Oct 2020 09:10:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[куки]]></title>
			<link>https://hms.lostcut.net/viewtopic.php?pid=17295#p17295</link>
			<description><![CDATA[<p>Подскажите в чем загвоздка не пишет куки в файл<br /> </p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>$url=curl(&#039;https://www.lostfilm.run/&#039;);
print_r($url);

function curl( $url, $post =&#039;&#039; , $mode = array( ) )
  {
    $defaultmode = array(
         &#039;charset&#039; =&gt; &#039;utf-8&#039;,
        &#039;ssl&#039; =&gt; 1,
        &#039;cookie&#039; =&gt; 1,
        &#039;headers&#039; =&gt; 1,
        &#039;useragent&#039; =&gt; &#039;Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36&#039; 
    );
    foreach ( $defaultmode as $k =&gt; $v )
      {
        if ( !isset( $mode[ $k ] ) )
            $mode[ $k ] = $v;
      }
    $header =array (
    &#039;Origin:http://www.lostfilm.tv&#039;);       
    $ch = curl_init();
    curl_setopt( $ch, CURLOPT_URL, $url );
    curl_setopt( $ch, CURLOPT_HEADER, $mode[ &#039;headers&#039; ] );
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt( $ch, CURLOPT_REFERER, $url );
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt( $ch, CURLOPT_USERAGENT, $mode[ &#039;useragent&#039; ] );
    curl_setopt( $ch, CURLOPT_ENCODING, $mode[ &#039;charset&#039; ] );
    curl_setopt( $ch, CURLOPT_AUTOREFERER, 1 );
    curl_setopt( $ch, CURLOPT_TIMEOUT, 200 );
    if ( $post )
      {
        curl_setopt( $ch, CURLOPT_POST, 1 );
        curl_setopt( $ch, CURLOPT_POSTFIELDS, $post );
        
      }
    if ( $mode[ &#039;cookie&#039; ] )
      {
    curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).&#039;/lostfilm.txt&#039;);
    curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).&#039;/lostfilm.txt&#039;);
      }
    curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY );
    curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
    if ( $mode[ &#039;ssl&#039; ] )
      {
        curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );
        curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );
      }
    //curl_setopt($ch, CURLINFO_HEADER_OUT, true);  
    $data = curl_exec( $ch );
    //$sent_headers = curl_getinfo($ch, CURLINFO_HEADER_OUT);
    //print_r( $sent_headers);
    curl_close( $ch );
    return $data;
  }</code></pre></div></div></div>]]></description>
			<author><![CDATA[null@example.com (bond)]]></author>
			<pubDate>Fri, 02 Oct 2020 09:10:04 +0000</pubDate>
			<guid>https://hms.lostcut.net/viewtopic.php?pid=17295#p17295</guid>
		</item>
	</channel>
</rss>
