felipeebs Posted August 12, 2007 Share Posted August 12, 2007 Hi, I have a form method="post" generated dynamically bu a "for" <form action="" method="post"> <?php $total = 10 //custom value for($i=1; $i<=$total; $i++) { $subdata=explode("][",$data[$i]); echo "<div>$i: <input type=\"text\" name=\"opt[$i]\" size=\"40\" maxlength=\"40\" value=\"$subdata[0]\" /> <input type=\"text\" name=\"img[$i]\" size=\"25\" maxlength=\"50\" value=\"$subdata[1]\" /> <input type=\"text\" name=\"num[$i]\" size=\"4\" maxlength=\"4\" value=\"$subdata[2]\" /> </div>"; } ?> <input type="submit" value="Submit" /> </form> It's ok in php 4, but in PHP 5 doesn't work. How to generate the variables to make the code php5 compilant? Thanks PS: IF possible, case not, how to make the code at all? PS2:The code is not mine, I'm just trying to make it compatible with php5 PS3: Not a perfect english mine ----- EDIT: the <form> code was not a copy&paste... in the original code it is ok and working Quote Link to comment https://forums.phpfreaks.com/topic/64548-dynamic-variables-to-dynamic-form-is-it-possible-how/ Share on other sites More sharing options...
plutomed Posted August 12, 2007 Share Posted August 12, 2007 One quick point: <form action="" methon="post"> You spelt method wrong I dunno if you have in your code just thought I'd point it out Quote Link to comment https://forums.phpfreaks.com/topic/64548-dynamic-variables-to-dynamic-form-is-it-possible-how/#findComment-321762 Share on other sites More sharing options...
felipeebs Posted August 12, 2007 Author Share Posted August 12, 2007 thanks for the advice "methon" was written wrong in the post... but in the code is written: <form name="APP" method="post" action=""> And the original post was edited Quote Link to comment https://forums.phpfreaks.com/topic/64548-dynamic-variables-to-dynamic-form-is-it-possible-how/#findComment-321766 Share on other sites More sharing options...
teng84 Posted August 12, 2007 Share Posted August 12, 2007 i guess not dynamic variable but dynamic value of variable any way its possible but we need explanation thats better that this any ways dynamic form usually obtain by using DB Quote Link to comment https://forums.phpfreaks.com/topic/64548-dynamic-variables-to-dynamic-form-is-it-possible-how/#findComment-321914 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.