I have this problem I am generating a list of inputs with the same name but different value.
<?php
if(isset($_POST['SubmitButton'])){ //check if form was submitted
$input = $_POST['inputText']; //get input text
$message = "Success! You entered: ".$input;
}
?>
<html>
<body>
<form action="#" method="post">
<?php echo $message; ?>
<?php
for($i = 0; $i<10; $i++){
echo '<input type="text" name="inputText" value="'.$i.'"/>
<input type="submit" name="SubmitButton"/>';
}
?>
</form>
</body>
</html>
When you click on some input, it returns the last assigned value. I guess that's why. As each input is called equal, it assigns the last value.
Any guidance to solve this problem?
I need each input to send the assigned value ..
Thank you very much