Agent M wrote:
I want to create a two column table in php. On the left column is my
navigation buttons. Each botton generates a report. I want to display this
report
in the right column. Each time I click a different button a different report
will
be displayed. How do I do this?
Here's a way, adapt it to your liking
[code]
<?php
function do_report1() { echo '<p>report one</p>'; }
function do_report2() { echo '<p>report two</p>'; }
###
?>
<html>
....
<table border="1"><tr>
<td>
<?php // column 1 (for buttons)
// the form action should be a full URL -- but this works for tests
echo '<form action="" method="post">';
// later will use the button value to know what to report
echo '<input type="submit" name="btn" value="one"><br/>';
echo '<input type="submit" name="btn" value="two"><br/>';
###
echo '<input type="submit" name="something_else" value="TRY ME TOO">';
?>
</form></td><td>
<?php // column 2 (for reports)
if (isset($_POST['btn'])) {
switch ($_POST['btn']) {
case 'one' : do_report1(); break;
case 'two' : do_report2(); break;
###
default: echo '<p>No! No! Not that one :)</p>';
} else {
echo '<p>Please select a report from the left</p>';
}
}
?>
</td></tr</table>
....
</html>
[code]
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--