How many forms are on this page?
The reason that it's showing up in an array and not in $_POST['ipaddress'] is this: <input name="ipaddress[abcd][]" id="ip" type="text" value="<?=$ip;?>" />
in the form html. The [abcd][]
causes it to make ipaddress an array containing an array with a key of 'abcd' of which the first available key gets populated with the value from the form. If you did <input name="ipaddress" id="ip" type="text" value="<?=$ip;?>" />
then the IP address would be available directly through $_POST['ipaddress']
.
If you have multiple forms, then use name="ipaddress[]"
and each form will populate a key of the $_POST['ipaddress']
array, so $_POST['ipaddress'][0]
will be the first form and $_POST['ipaddress'][1]
will be the second form and so on.