I have a page that does a whole bunch of stuff, until the visitor clicks a form button. The form submits to itself ($php_self).
If it's submitted, the entire php page is totally completely replaced by another entire php page (html, head, body, everything!).
I've found that it is NOT necessary to include "exit" after the "include" function. Should I go ahead and put that "exit" in anyway?
Here are my "technical-and-obsessively perfectionistic" questions:
1.) Is the following gramattically syntaxically correct?
2.) do I need the "else" in there if I have the "exit".... or, is the purpose of the "exit" so I don't have to put the "else" in there
Here's the code:
<?php
if (isset($formbutton)) {
include('./next_page.php');
exit;
}
else
{
?>
<head></head><body>etc., etc.
<?php
}
?>
And, finally, How should I know whether and to do reverse statements? For example, my code above starts with if(isset($formbutton))..... I could easily start it with if(!isset($formbutton)) .....
if I do that, would it make the php go thru my entire page to get to where it's supposed to? does php work like that?
Thanks!