php curl CURLOPT_HEADER ve dom

0 Cevap php

Ben aşağıdaki kodu vardır:

curl_setopt($ch, CURLOPT_URL, $host);
  curl_setopt($ch, CURLOPT_HEADER, 1); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  $html = curl_exec($ch);


  preg_match_all('|Set-Cookie: (.*);|U', $html, $results);  
  $cookies = implode(';', $results[1]);


  $dom = new DOMDocument();
  $dom->loadHTML($html);

on line $dom->loadHTML($html); ben aşağıdaki hatayı alıyorum:

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]:
Misplaced DOCTYPE declaration in
Entity, line: 12 in
D:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.php
on line 39

Warning: DOMDocument::loadHTML()
[function.DOMDocument-loadHTML]:
htmlParseStartTag: misplaced 
tag in Entity, line: 13 in
D:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.php
on line 39

Warning: DOMDocument::loadHTML()
[function.DOMDocument-loadHTML]:
htmlParseStartTag: misplaced 
tag in Entity, line: 14 in
D:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.php
on line 39

Warning: DOMDocument::loadHTML()
[function.DOMDocument-loadHTML]:
Unexpected end tag : head in Entity,
line: 32 in
D:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.php
on line 39

Warning: DOMDocument::loadHTML()
[function.DOMDocument-loadHTML]:
htmlParseStartTag: misplaced 
tag in Entity, line: 34 in
D:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.php
on line 39

Hattı bu hatanın curl_setopt($ch, CURLOPT_HEADER, 1); neden mi? Çünkü kurabiye gerek. Bu çözmek konusunda herhangi bir fikir?

0 Cevap