ajentp Posted September 13, 2009 Share Posted September 13, 2009 Hi I am trying to make a Form which can pass multiple inputs using varibale DisEarn[$x] to add2.php file where that input can be processed. However I am not receiving the value. Here is the lines of code for the Form for($x=0; $x<2; $x++) { echo "<td align='center' bgcolor='#009933'><font face='Tahoma' size='2' color='#FFFFFF'><b>"; echo "<input type = 'text' name='DisEarn[$x]' Size='10' />"; echo"</font></b></td>"; } echo "</tr><tr>"; echo"<input type='submit' value='Submit' name='B1'></form>"; And here is the line of code for add2.php for($x=0; $x<2; $x++) { $DisEarn1 = $_GET['DisEarn[$x]']; echo "Here".$DisEarn1."<br>"; } I tried $_POST, $_GET, $_REQUEST, nothing work. Any help please? Thanks & Regards, Link to comment https://forums.phpfreaks.com/topic/174095-php-form-help/ Share on other sites More sharing options...
ajentp Posted September 13, 2009 Author Share Posted September 13, 2009 Never mind I found out: First I changed the method to POST in Form file. Then add " " instead of ' ' for $_POST command in add2.php. It works now for($x=0; $x<2; $x++) { $DisEarn[] = $_POST["DisEarn[$x]"]; echo "First-".$DisEarn[$x]."<br>"; } Link to comment https://forums.phpfreaks.com/topic/174095-php-form-help/#findComment-917799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.