Помогите заэкранировать

Статус
В этой теме нельзя размещать новые ответы.

Compressor

Мой дом здесь!
Регистрация
31 Янв 2009
Сообщения
311
Реакции
202
Шаблон в некой кмс забивается целеком в одну переменную... и где-то наверное потом выводится =)

HTML:
<?
$tmp='
<html>
<head></head>
<body></body>
</html>
'
?>

Помогите, пожалуста, вывести счетчик от liveinternet.

HTML:
<!--LiveInternet counter--><script type="text/javascript">document.write("<a href='http://www.liveinternet.ru/click' target=_blank><img src='http://counter.yadro.ru/hit?t25.6;r" + escape(document.referrer) + ((typeof(screen)=="undefined")?"":";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' border=0 width=88 height=15 alt='' title='LiveInternet: показано число посетителей за сегодня'><\/a>")</script><!--/LiveInternet-->

Как понимаю есть недопустимые символы, ведь если просто вставить его ругается =(
 
можеш сделать типа так:
PHP:
<?
$tmp=<<<HTML
<html>
<head></head>
<body></body>
<!--LiveInternet counter--><script type="text/javascript">document.write("<a href='http://www.liveinternet.ru/click' target=_blank><img src='http://counter.yadro.ru/hit?t25.6;r" + escape(document.referrer) + ((typeof(screen)=="undefined")?"":";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' border=0 width=88 height=15 alt='' title='LiveInternet: показано число посетителей за сегодня'><\/a>")</script><!--/LiveInternet-->
</html>
HTML;
?>
 
Да. Такой метод работает.
 
а почему после </body> ?
пишите валидный html
PHP:
<? 
$tmp=<<<HTML 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head><title>test</title></head> 
<body>
<!--LiveInternet counter--><script type="text/javascript">document.write("<a href='http://www.liveinternet.ru/click' target=_blank><img src='http://counter.yadro.ru/hit?t25.6;r" + escape(document.referrer) + ((typeof(screen)=="undefined")?"":";s"+screen.width+"*"+screen.height+"*"+(screen.colorDepth?screen.colorDepth:screen.pixelDepth)) + ";u" + escape(document.URL) + ";" + Math.random() + "' border=0 width=88 height=15 alt='' title='LiveInternet: показано число посетителей за сегодня'><\/a>")</script><!--/LiveInternet--> 
</body>
</html> 
HTML; 
?>
 
Статус
В этой теме нельзя размещать новые ответы.
Назад
Сверху