The code snippets below are examples of how I have been triggering executable directives. Actually, the code I've been writing is more jumbled-up. I've pared it down for illustrative purposes.
On "FirstPage.php" below there is a hidden field with the name "FinalDelete". There also is a submit button named "DeletePictureFolder".
What I'm doing is simply using the hidden field to trigger execution of the first part of the script on "NextPage.php" (below) and the submit button named "DeletePictureFolder" to trigger execution of the second part of the script below.
Other than triggering execution of the scripts on the next page the hidden field does not have any function.
The function of the submit button is to get to the next page. For convenience, I've also named the submit button "DeletePictureFolder" so it will triger the isset function on the next page.
My question is: Will the way I'm doing it cause any kind of problems? The script seems to be working ok but I'm just wondering if the way I'm doing it is adaquate programming. In other words, is there a more generally accepted way of triggering "isset" functions than the way I'm doing it below?
// First Page
<form method="post" action="NextPage.php">
// Hidden field - no purpose other than to trigger isset function on next page.
<input type="hidden" name="FinalDelete">
// Submit button - has a purpose but for convenience also making it trigger isset on next page.
<input type="submit" name="DeletePictureFolder" value="Click To Delete" class="submit1">
</form>
// NextPage.php
if (isset($FinalDelete)){
// Execute final delete snippet here.
if (isset($DeletePictureFolder)){
// Execute something else here.}
}
Thanks.