I want to display a table on a page based on whether a button is
pressed or not. I'm new at php so I'm sure I'm making a basic
mistake. Here's what I am trying. My thought was that $show_summary
would switch states with each click but it is coming up always true.
So I'm guessing that is the default setting when the page loads. Can
someone please point out where I am going wrong?
if(isset($_POST['summary'])) {
$show_summary = true;
} else {
$show_summary = false;
}
<FORM method="POST" action="testpag e.php">
<INPUT type="submit" name="summary" value="Show Summary">
</FORM>
<?php if ($show_summary == true) { ?>
<table border="1" cellpadding="3" >
<tr>
<td class="smallTex t" align="center" width="80%"><?p hp echo "URL";
?></td>
</tr>
</table>
<?php } ?>
Jack