Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   Нужен скрипт обработки ссылок (https://forum.antichat.xyz/showthread.php?t=109341)

termos.tif 05.03.2009 14:09

Нужен скрипт обработки ссылок
 
Нужен скрипт обработки ссылок.
Есть ссылка вида:
<a href="javascript:if(confirm('http://teensexmania.com/jump.php?account=12 \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://teensexmania.com/jump.php?account=12'" tppabs="http://teensexmania.com/jump.php?account=12"><IMG height=193 alt="Teen Sex Movs" src="tsm2.jpg" tppabs="http://teenmegaworld.com/index_files/tsm2.jpg" width=218 border=0></a>

Нужно получить:
<a href="http://teenmegaworld.com/index_files/tsm2.jpg" width=218 border=0></a>

termos.tif 05.03.2009 15:05

Согласен. Пишите в аську 9888107

Lempert 05.03.2009 16:10

PHP код:

<?php
$source 
=<<<EOF
<a href="javascript:if(confirm('http://teensexmania.com/jump.php?account=12 \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://teensexmania.com/jump.php?account=12'" tppabs="http://teensexmania.com/jump.php?account=12"><IMG height=193 alt="Teen Sex Movs" src="tsm2.jpg" tppabs="http://teenmegaworld.com/index_files/tsm2.jpg" width=218 border=0></a>
EOF;

$start strpos($source'jpg" tppabs=') + 12;
$prom substr($source$start);
$finish '<a href='.$prom;
echo 
$finish;
?>

Без регулярных выражений, возможно, не очень красиво... но задачу поставленную выполняет :)

termos.tif 05.03.2009 16:37

Не. Не то... Я напісал образно =) Есть хтмл файл с ссылками такого вида. Их нужно сделать вида как я указал

termos.tif 05.03.2009 16:51

Неужели никто не может написать скрипт??? Моя ася 9888107

termos.tif 05.03.2009 18:04

Ну же. Где все опытные программисты???

diehard 05.03.2009 20:08

Писать минуты 3, но не хочу )) ТС, тут что тебе форум кодеров-фрилансеров?

Gaus 05.03.2009 20:10

Цитата:

Сообщение от termos.tif
Ну же. Где все опытные программисты???

На халяву писать? :D

termos.tif 05.03.2009 20:39

Нет

попугай 06.03.2009 03:40

PHP код:

<?php
$text 
=<<<HTML
<a href="javascript:if(confirm('http://teensexmania.com/jump.php?account=12 \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://teensexmania.com/jump.php?account=12'" tppabs="http://teensexmania.com/jump.php?account=12"><IMG height=193 alt="Teen Sex Movs" src="tsm2.jpg" tppabs="http://teenmegaworld.com/index_files/tsm2.jpg" width=218 border=0></a>
HTML;



preg_match('|<IMG (.*?) tppabs=(.*?)border=0|'$text$mas);


echo 
'<a href=' $mas[2] . ' border=0>link</a>';
?>



Время: 05:20