<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Неофициальный форум DLNA Home Media Server &mdash; куки]]></title>
	<link rel="self" href="https://hms.lostcut.net/extern.php?action=feed&amp;tid=819&amp;type=atom" />
	<updated>2020-10-02T09:10:04Z</updated>
	<generator>PunBB</generator>
	<id>https://hms.lostcut.net/viewtopic.php?id=819</id>
		<entry>
			<title type="html"><![CDATA[куки]]></title>
			<link rel="alternate" href="https://hms.lostcut.net/viewtopic.php?pid=17295#p17295" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[bond]]></name>
				<uri>https://hms.lostcut.net/profile.php?id=844</uri>
			</author>
			<updated>2020-10-02T09:10:04Z</updated>
			<id>https://hms.lostcut.net/viewtopic.php?pid=17295#p17295</id>
		</entry>
</feed>
