moje rozwiązanie :
Linki
Kod
http://cos.pl||njlepsze cos na swiecie
http://php.pl||php.pl
http://muah.pl||muah mueh
rotator :
Kod
<?
$w1 = urldecode($_GET['wo']);
$w2 = urldecode($_GET['wt']);
$linki = rtrim(file_get_contents('linki.txt'));
$linkz_e = explode("\r\n", $linki);
$link_e = array_rand($linkz_e, $_GET['il']);
for($i=0;$i<=$_GET['il']-1;$i++) {
$full = $linkz_e[$link_e[$i]];
list($link, $desc) = explode("||", $full);
echo $w1.'<a href="'.$link.'">'.$desc.'</a> '.$w2;
}
?>
i to co dajemy na strony :
Kod
<?php
$content = "";
$w1 = urlencode('<li>');
$w2 = urlencode('</li>');
$il = 6;
$url = "http://strona-gdzie-jest-skrypt.pl/links.php?wo=".$w1."&wt=".$w2."&il=".$il;
if(function_exists(curl_init)) {
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
$content = curl_exec ($ch);
curl_close($ch);
} elseif (function_exists(file_get_contents)) {
$content = file_get_contents($url);
} elseif (ini_get('allow_url_fopen')) {
$content = fopen($url);
} elseif(!$content) {
$content = include_once($url);
}
echo $content;
?>