Slightly strange behaviour going on here so hopefully someone can shed some light. Here's the form:
<fieldset>
<legend>Create a new section:</legend>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<label for="New Chapter">New Section Title</label>
<input type="text" name="newch" id="New Chapter" /><br />
<input type="hidden" name="num" value="<?php echo $_POST['num']; ?>" class="hidden" />
<input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" class="hidden" />
<input type="submit" name="submit_new_chapter" value="Create New Section" title="create new section" class="submit" />
</form>
</fieldset>
The action to the form is called depending on the name in the submit.
// New chapter required for text?
if (isset($_POST['submit_new_chapter'])) {
include '../../inc/lib/usercp_edit_3bb.php';
}
This includes a file in the central edit page that inserts, deletes etc but only does this on condition that $_POST['submit_new_chapter']) is set.
However, now and again - and that's the weird thing - the following page comes up blank. After running a check on all variables being passed to the final include, on the occasion that there is a blank page, there are no variables being passed, therefore $_POST['submit_new_chapter']) is not being found by the central edit page.
So, the problem appears to be with the form sometimes sending the submit and other vars and sometimes just sending the vars (something I thought couldn't happen until I saw it with my own eyes!)
If anyone has any idea as to why this might happen, then please let me know. I'm bemused, bothered and definitely bewildered. But I'm sure it's something blatantly obvious!
Cheers.