I am working on a form and it looks like this
<form name="project" method="post" action="result.php">
Address: <input name="address[line1]" type="text"/>
</form>
In the result.php, I use the following code to get the input
<?php echo (isset ($_POST['address[line1]') ? $_POST ['address [line1]'] : 'fail') ?>
However, I keep getting 'fail' on my page instead of catching the input address[line1], and the strange thing is when I change the name to "addressLine1" it works perfectly, can anyone advise me on this?
I am new to web development and I am pretty confused now.
[]are used for arrays. Plus, you're missing aniffor yourisset.