Hello everyone.I am learning arrays in PHP.I tried to take 6 text inputs and store it ina a array and then display when we click submit button.But I am not getting output.Below is my code.Please help me out.
<html> <head> <title> List Function </title> </head> <body> <?php if(isset($_POST['posted'])) { for($count=0;$count<=5;$count++) { $a = $_POST['hidden'][$count]; echo "$a<br/>"; } } ?> <form method = "POST" action = "listfunction.php"> <input type = "hidden" name = "posted" value = "true"/> <?php for($counter=0;$counter<=5;$counter++) { echo "<input type = 'text' name = '$array[$counter]'><br/>"; echo "<input type = 'hidden' name = 'hidden[]' value = '$array[$counter]'>"; } ?> <input type = "submit" value = "submit"/> </body> </html>
Thank you.