Thanks for the reply.
I originally had may values in $test['0'], but reduced it to one in an attempt to debug.
This is still baffling to me. I copied the devshed tutorial code and look at my results:
PHP script:
Code:
<?
include_once "template.inc";
$T = new Template();
$T->set_file('input_two', 'two.ihtml');
$T->set_block('input_two', 'AccessBlock', 'ABlock');
$want_list=array(
0 => 'Baseball bat',
1 => 'Remote Control car',
2 => 'Wagon'
);
for ($i=0; $i<sizeof($want_list); $i++) {
$T->set_var('item', $want_list[$i]);
$T->Parse('ABlock', 'AccessBlock', true);
}
$T->pparse('Output', 'input_two');
?>
HTML file:
Code:
A list of what I want for Christmas:
<OL>
<!-- BEGIN AccessBlock -->
<LI> {item}
<!-- END AccessBlock -->
</OL>
And here is the output:
Code:
A list of what I want for Christmas:
<OL>
ABlock
</OL>
I'm using PHP v. 4.0.3pl1 and only the template.inc from phplib.
Bookmarks