I am not strong at PHP at all. I need to hide the HTML table when if($_POST['isevent']) occurs. Can you guys show me how this can be done? if($_POST['isevent']) ... hide <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> else ... show
Going by the logic you've posted your wanting to see if data isset for the boolean but for efficiency for your conditional it's easer to bypass the else statement and ask if the event is false ie: !isset and echo table from there. example code: if (!isset($_POST['isevent'])) { echo '<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>' ; } PHP: This is the equivalent behavior to if (isset($_POST['isevent'])) ... hide which it doe's on default, and will invoke else ... show if event is false: !isset. ROOFIS
Remove the table completely from your PHP code. Then add: if (!isset($_POST['isevent'])) { echo '<table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>'; } PHP: