Language:
PHP/PHP 3-4     Change language:
Pastebin: 71330
Author: abstrakt
Subject: Re: OB for templates
Created: 2007-07-25 19:10:56
Download and save
Toggle line numbers
1<!-- mypage.php --> 
2<?php 
3        $title = 'My Page'; 
4 
5        $rs = mysql_query()
6 
7        ob_start()
8        include('template.php')
9        $content = ob_get_clean()
10        include('layout.php')
11?> 
12 
13<!-- template.php --> 
14<table> 
15        <tr> 
16                <th>ID</th> 
17                <th>Name</th> 
18                <th>Description</th> 
19        </tr> 
20        <?php while ($row = mysql_fetch_assoc($rs)): ?> 
21        <tr> 
22                <th><?php echo $row['id']; ?></th> 
23                <th><?php echo $row['name']; ?></th> 
24                <th><?php echo $row['description']; ?></th> 
25        </tr> 
26        <?php endwhile; ?> 
27</table> 
28 
29<!-- layout.php --> 
30<html> 
31        <head> 
32                <title><?php echo $title; ?></title> 
33        </head> 
34        <body> 
35                <div id="main"> 
36                        <?php echo $content; ?> 
37                </div> 
38        </body> 
39</html> 
40<?php exit; ?> 
41 
Thread:
[71330] Re: OB for templates by abstrakt at 2007-07-25 19:10:56
Tip: Click the line numbers to toggle highliting on that line.

Paste followup:

Language:
Author:
Subject:


    Tabstop:     bigger biggest
Note: You can prefix a line with "@@@" to highlight it.