I'm slowly getting there with PHP templates! :)
Here's my basic PHP page:

<TITLE>Star FM</TITLE>
<head>
<style type="text/css">
  CAPTION.MYTABLE
  {
     background-color:#8080ff;
     color:white;
     border-style:solid;
     border-width:0px;
     border-color:black;
  }

  TABLE.MYTABLE
  { 
     font-family:arial;
     font-size:10pt;
     background-color:#2554C7;
     width:780px;
     border-style:solid;
     border-color:black;
     border-width:0px;
  }

  TH.MYTABLE
  {
     font-size:10pt;
     color:white;
  }


  TR.MYTABLE
  { 
  }

  TD.MYTABLE
  {  
     font-size:10pt;
     background-color:#2554C7;
     color:white;
     border-style:solid;
     border-width:0px;
     text-align:center;
  }
</style>
  <TABLE CLASS="MYTABLE">
    <THEAD >
      <TR CLASS="MYTABLE">
        <TH CLASS="MYTABLE">Monday</TH>
        <TH CLASS="MYTABLE"></TH>
        <TH CLASS="MYTABLE"></TH>
         <TH CLASS="MYTABLE"></TH>
         <TH CLASS="MYTABLE"></TH>
      </TR>
    </THEAD>
    
    <TBODY>
      <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">12:00am</TD>
        <TD CLASS="MYTABLE">6:00am</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">Star Non Stop</TD>
         <TD CLASS="MYTABLE"></TD>
      </TR>
   
      <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">6:00am</TD>
        <TD CLASS="MYTABLE">10:00am</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">Star Breakfast</TD>
        <TD CLASS="MYTABLE">John Doe on Star Breakfast for Loamshire</TD>
      </TR>
   
      <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">10:00am</TD>
        <TD CLASS="MYTABLE">3:00pm</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">Star Workday Non Stop</TD>
        <TD CLASS="MYTABLE">More music variety</TD>
      </TR>
      
       <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">3:00pm</TD>
        <TD CLASS="MYTABLE">7:00pm</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">Star Drivetime with John Smith</TD>
        <TD CLASS="MYTABLE">More music variety</TD>
      </TR>
      
        <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">7:00pm</TD>
        <TD CLASS="MYTABLE">11:00pm</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">Star Non Stop</TD>
        <TD CLASS="MYTABLE">More music variety</TD>
      </TR>
      
       <TR CLASS="MYTABLE">  
        <TD CLASS="MYTABLE">11:00pm</TD>
        <TD CLASS="MYTABLE">12:00am</TD>
        <TD CLASS="MYTABLE"><IMG src="nonstop.jpg"></TD>
        <TD CLASS="MYTABLE">The Love Zone</TD>
         <TD CLASS="MYTABLE">More music variety to chill to</TD>
      </TR>
      
    </TBODY>
  </TABLE>

I'm trying to do it so that the entire tables' content is a variable,
using the PHP coding, so I don't have to manually edit the page every time.

The current page above is schedule1.php.

What should I do to get a template with variables working??
I'm trying to set the show start and end times, presenter names, pictures and show descriptions as variables but haven't quite got there though. It's almost but not quite worked!

All help appreciated!

Your title tag should be within the head of the document ;)

Rather than re-inventing the wheel, you may want to look at [www.smarty.net]Smarty[/url], it does everything you are looking for, you can get an array of data and have it auto output as a table - if you understand HTML and php then the learning curve should not be very steep.

Of course, i'm not saying you can't build your own - just that there are free solutions which do exactly what you want readily available.

Also, this is probably just me, but I find all caps on code hideous and annoying, especially since XHTML 1 says it should be lower case (if you are using HTML 4 then this is irrelevant, but as I said, its probably just me :))

This article has been dead for over six months. Start a new discussion instead.