I have a php file with a name kal_test.phpthat assigns a value to a variable $vbl. This variable is needed in a file with a name kal_generator.phpthat creates a table from this variable (I will show you the details). This happens as follows:
[kal_test.php]
<?php
$vbl = "14/09/2011";
include ("kal_generator.php");
?>
[kal_test.php]
<?php
?>
<table>
<tr><th>bla</th><th>blabla</th></tr>
<?php
foreach ($output as $v1) {
echo "<tr>";
foreach ($v1 as $v2) {
echo "<td>$v2</td>";
}
echo "</tr>\n";
}
?>
</table>
This setting works fine, but I can’t do two of them on the same page, for example:
[kal_test.php]
<?php
$vbl = "14/09/2011";
include ("kal_generator.php");
$vbl = "21/09/2011";
include ("kal_generator.php");
?>
This will produce the following result:
//here comes the header
<table> // table created with $vbl = "14/09/2011"
<tr><th>bla</th><th>blabla</th></tr>
<tr><td>this</td><td>works</td></tr>
<tr><td>this</td><td>works</td></tr>
</table>
//here should the second table be and also the rest of the page (footer), this is completely missing
What am I doing wrong? Thank!
source
share