php multi curl problem

i want to get several pages thru \[code\]curl_exec\[/code\], first page is come normally, but all others - \[code\]302 header\[/code\], what reason?\[code\]$curl = curl_init();curl_setopt($curl, CURLOPT_URL, ROOT_URL);curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);$content = curl_exec($curl); // here good contentcurl_close($curl);preg_match_all('/href="http://stackoverflow.com/questions/3600247/(/users/[^"]+)"[^>]+>\s*/i', $content, $p);for ($j=0; $j<count($p[1]); $j++){ $new_curl = curl_init(); curl_setopt($new_curl, CURLOPT_URL, NEW_URL.$p[1][$j]); curl_setopt($new_curl, CURLOPT_RETURNTRANSFER, 0); $content = curl_exec($new_curl); // here 302 curl_close($new_curl);preg_match('/[^@]+@[^"]+/i', $content, $p2);\[/code\]}smth like this
 
Back
Top