Цитата:
Сообщение от digg
база урлов urls.txt
PHP код:
dom1|http://google.com
dom2|http://ya.ru
dom3|...
...
сам page.php
PHP код:
<?
$urls = file('urls.txt');
foreach($urls as $v){
$a = explode('|',trim($v));
if(strcmp($a[0],$_GET['p'])==0){
$redirect_url = $a[1];
}
}
print('<script>window.location.replace("'.$redirect_url.'");</script>');
?>
|
Чет не хочет:
Warning: file(urls.txt) [function.file]: failed to open stream: No such file or directory in Z:\home\test1.ru\www\page.php on line 2
Warning: Invalid argument supplied for foreach() in Z:\home\test1.ru\www\page.php on line 3
window.location.replace("");