php curl CURLOPT_HEADER and dom

ProX

New Member
I have the following code:\[code\]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);\[/code\]on line $dom->loadHTML($html); I am getting the following error:Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]:Misplaced DOCTYPE declaration inEntity, line: 12 inD:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.phpon line 39Warning: DOMDocument::loadHTML()[function.DOMDocument-loadHTML]:htmlParseStartTag: misplaced tag in Entity, line: 13 inD:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.phpon line 39Warning: DOMDocument::loadHTML()[function.DOMDocument-loadHTML]:htmlParseStartTag: misplaced tag in Entity, line: 14 inD:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.phpon line 39Warning: DOMDocument::loadHTML()[function.DOMDocument-loadHTML]:Unexpected end tag : head in Entity,line: 32 inD:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.phpon line 39Warning: DOMDocument::loadHTML()[function.DOMDocument-loadHTML]:htmlParseStartTag: misplaced tag in Entity, line: 34 inD:\Programs\xampp\xampp\htdocs\ip\megafonmoscow.phpon line 39Is the line \[code\]curl_setopt($ch, CURLOPT_HEADER, 1);\[/code\] cause of this error? I need it because of the cookies. Any ideas on how to solve this?
 
Back
Top