Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Wstawienie kodu w tabelkę
Forum PHP.pl > Forum > PHP
pirex
Witam mam pewien problem... Otóż mam taki kod:

Kod
// The "key stats" box.
echo '
<td class="headerdown" align="right" width="40%" style="padding-right: 8px;">
</td>
</tr>
</table>
</td>';


I w tą tabelkę:

Kod
<td class="headerdown" align="right" width="40%" style="padding-right: 8px;"></td>


chcę wstawić ten kod:

Kod
<?php
if (include(getenv('DOCUMENT_ROOT').'banery/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 12, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>


Zrobiłem to w taki sposób:

Kod
// The "key stats" box.
echo '
<td class="headerdown" align="right" width="40%" style="padding-right: 8px;">
<?php
if (include(getenv(\'DOCUMENT_ROOT\').\'banery/phpadsnew.inc.php\')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw (\'\', 12, \'\', \'\', \'0\', $phpAds_context);
echo $phpAds_raw['html'];
}
?>
</td>
</tr>
</table>
</td>';


Ale niestety mam błąd:

Cytat
Template Parse Error!
There was a problem loading the /Themes/saforange105/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from php, try accessing the file directly.

You may want to try to refresh this page or use the default theme.


----edit----
Proszę poprawić posta używając odpowiednich tagów bbCode exclamation.gif!
~mike_mech
Fipaj
Zamień wszystkie ' i \' na ", zacznie działać...
pirex
Wszystkie to znaczy z całego kodu - począwszy od echo ' - a kończąc na </table>
</td>'; ?
Pigula
  1. echo '
  2. <td class="headerdown" align="right" width="40%" style="padding-right: 8px;">
  3. <?php
  4. ?>

chba najpierw <?php a potem echo?
pozatym mozna tak:
  1. <td class="headerdown" align="right" width="40%" style="padding-right: 8px;">
  2. <?php
  3. if (include(getenv('DOCUMENT_ROOT').'banery/phpadsnew.inc.php')) {
  4. if (!isset($phpAds_context)) $phpAds_context = array();
  5. $phpAds_raw = view_raw ('', 12, '', '', '0', $phpAds_context);
  6. echo $phpAds_raw['html'];
  7. }
  8. ?>
  9. </td>
  10. </tr>
  11. </td>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.