Ну не правильно термины написал, начинающий я еще...
пробовал я соединить, не работает.
Может код посмотришь:
$spi=strtolower($spi);
preg_match_all
("/(http:\\/\\/)?(depositfiles+\\.[a-z]{2,3}(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/", $spi, $ur);
for($i=0; $i<count($ur[2]); $i++)
{
$wer = $ur[0][$i];
echo "<a href=?value=$wer&id=1>$wer</a><br>";
}
результат:
http://depositfiles.com/files/9rh8wc4gl
http://depositfiles.com/files/1ckjs1s7x
http://depositfiles.com/files/3ccm1tgs0
http://depositfiles.com/files/lu89xhlw9
http://depositfiles.com/files/n8qmcre6a
http://depositfiles.com/files/52pomzf4n
http://depositfiles.com/files/c9sa96yne
http://depositfiles.com/files/hvvxdw57z
http://depositfiles.com/files/94syry9oa
http://depositfiles.com/files/w1ncqauoj
http://depositfiles.com/files/2ly05nbg9
http://depositfiles.com/files/l69hdgnvq
http://depositfiles.com/files/m2gullgw8
http://depositfiles.com/files/7fzslhwpk
http://depositfiles.com/files/49q6xtqy5
http://depositfiles.com/files/s63mwllnu
http://depositfiles.com/files/cy1wuehdf
http://depositfiles.com/files/kzuocahnb
http://depositfiles.com/files/0fvmayi25
http://depositfiles.com/files/wdncgqy9n
http://depositfiles.com/files/p121126py
http://depositfiles.com/files/jdvovqcun
При переходе по гиперссылке идем сюда:
$url=$_GET['value'];
$post = "login=tit&password=ab";
$cookie = str_replace('\\', '/', dirname(__FILE__)) . 'cookie.txt';
$filename = tempnam("/tmp", "url");
$fp = fopen ($filename, "wb+");
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FILE, $fp);
$result = curl_exec($ch);
curl_close($ch);
$result = file_get_contents($filename);
preg_match_all ("/(?<=\<a\ href\=\")(http:\\/\\/)?([a-z_0-9-.]+\\.[com,ru]{2,3}(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?))\.rar)(?=\"\sonClick\=\"download_started\(\)\;\"\sclass\=\"hide_download_started\"\>Скачать файл\<)/", $result, $url);
$com=$url[0][0];
print "<a href=".$com.">$com</a><p></p>";
fclose($fp);
unlink($filename);
Результат:
http://nguest168.depositfiles.com/auth-361229415174_80.254.111.60-a8a1f7a7-405968819/10743390/FS168-7/Skazki.juga.2006.P.part01.rar
Который замещает все те ссылки, а нужно в конец списка добавить, и чтоб при нажатии на все остальные результат тоже добавлялся...