| |
автор: Banz (20.06.2006 в 18:14) |
|
| | Можноли присвоить инклуд к преременной?
Мне вообще нужно в шаблоне заменить Слово {code}, через php скрипт на код!
И должно получиться чтотото вроде
<?php
$text = file_get_contents("shablon.htm");
$text = str_replace("{code}", include "code.php", $text);
echo $text;
?>
|
| |
| |
|
|
| |
|
|
| |
для: Banz
(20.06.2006 в 18:14)
| | | что то такое:
<?php
$text = file_get_contents("shablon.htm");
$script=file_get_contents('code.php');
$text = str_replace("{code}", $script, $text);
eval($text);
?>
|
| |
| |
|
|
| |
|
|
| |
для: Banz
(20.06.2006 в 18:14)
| | | как то коряво это выглядит...
а что у вас происходит таково в файле code.php?
помоему будет лучше разделить
<?php
include ("code.php");
//в нем результат обработки поместить в переменную и вернуть ее - $var
$text = file_get_contents("shablon.htm");
$text = str_replace("{code}", $var, $text);
echo $text;
?>
|
| |
| |
|
|
| |
автор: Banz (20.06.2006 в 18:31) |
|
| |
для: kolobokk
(20.06.2006 в 18:20)
| | | У меня там:
<?php
$file = file("ПАПКА.txt");
foreach($file as $bla)
{
$bla = explode("||", $bla);
$bla[1] = trim($bla[1]);
echo "<a href=\"javascript:insertext(' :$bla[1]: ','','short','rt','msg')\" style=\"text-decoration: none\">
<img src=\"smile/$bla[0]\" border=\"0\"></a>";
}
?> | |
| |
|
|
| |
|
|
| |
для: Banz
(20.06.2006 в 18:31)
| | | А мой код не подошёл?
<?php
$text = file_get_contents("shablon.htm");
$file = file("ПАПКА.txt");
$return='';
foreach($file as $bla)
{
$bla = explode("||", $bla);
$bla[1] = trim($bla[1]);
$return.= "<a href=\"javascript:insertext(' :$bla[1]: ','','short','rt','msg')\" style=\"text-decoration: none\">
<img src=\"smile/$bla[0]\" border=\"0\"></a>";
}
$text = str_replace("{code}", $return, $text);
echo $text;
|
| |
| |
|
|
| |
|
|
| |
для: Banz
(20.06.2006 в 18:31)
| | | замените echo на $var.= | |
| |
|
|