Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: sanax on July 02, 2009, 04:36:08 PM

Title: Embed php code in <table> tags
Post by: sanax on July 02, 2009, 04:36:08 PM
I'd like to embed the following .php code inside <table> tags... but I can't get to work in the index_template.php

<?
include_once("adverts.php");
echo "<div align='center'>$bannerAd</div>";
?>


It's a banner rotate code...
Title: Re: Embed php code in <table> tags
Post by: sanax on July 03, 2009, 09:42:15 AM
Quote from: Arantor on July 02, 2009, 06:49:16 PM
Where do you want to put it?

I added a html table with 4 colomns just below the heading inside the index_template.php ... I thought to add 4 rotaing banners within the table... but it seems to clash with the rest of the coding!
Title: Re: Embed php code in <table> tags
Post by: sanax on July 04, 2009, 11:32:36 AM
..any idea on how I should change the code as posted in my first post?
Title: Re: Embed php code in <table> tags
Post by: Orstio on July 04, 2009, 01:07:48 PM
If short_open_tags is turned off, you'll need a real PHP opening tag:

<?php include_once("adverts.php"); echo "<div align='center'>$bannerAd</div>";?>
Title: Re: Embed php code in <table> tags
Post by: Orstio on July 04, 2009, 01:26:11 PM
I remember PHP being recursive inside echo.  I just checked, and it definitely is not in PHP 5.  :-\