I have a large form written in HTML (with 1,000+ input elements). I have set the action of the form to update.php, but was encountering some strange behaviour. It seems as though the $_POST is being reset somewhere along the lines.
Here’s what update.php looks like:
<?php
empty($_POST);
print_r($_POST);
?>
Which outputs:
Array
(
[date] => 3 October 2012
[date2] =>
[to] =>
[number] => 0005
[contact] =>
[address] =>
[contact_tel] =>
[contact_fax] =>
[contact_mob] =>
[contact_email] =>
[site_contact] =>
[site_address] =>
[site_contact_tel] =>
[site_contact_fax] =>
...
);
The strange thing is that $_POST['date'] has no value (i.e. it’s an empty field). Even refreshing update.php and re-posting the form has no effect. The values that the PHP is reporting are the original values from the first time that I submitted the form.
Changing the action to $_GET functions as expected (i.e. the correct variables are passed in the link), but I cannot use this solution, mainly because the URL become too long and causes a server error.
Does anyone why this is occurring. I would post my code, but it’s too long.
Here’s a PastBin of the form’s HTML > http://pastebin.com/rdQujigK
I rest my case.