Demonic Posted March 8, 2008 Share Posted March 8, 2008 Right I was looking at vB's source code trying to figure out how they did the update forum order, so I found this: $cell[] = "<input type=\"text\" class=\"bginput\" name=\"order[$forum[forumid]]\" value=\"$forum[displayorder]\" tabindex=\"1\" size=\"3\" title=\"" . $vbphrase['edit_display_order'] . "\" />"; order[1] if I did $_POST['order'][1];//would that get that value? If I did something like the code above but in another way? Quote Link to comment Share on other sites More sharing options...
cytech Posted March 8, 2008 Share Posted March 8, 2008 In theory yes - that would pull any string in the "value" attribute. Quote Link to comment Share on other sites More sharing options...
Demonic Posted March 8, 2008 Author Share Posted March 8, 2008 In theory? (isn't theory) <?php if(!isset($_POST['form'])) { ?> <form method='post'> <input type='text' name='order[1]' value='1' /> <input type='text' name='order[2]' value='2' /> <input type='text' name='order[3]' value='1' /> <input type='text' name='order[4]' value='3' /> <input type='text' name='order[5]' value='1' /> <input type='text' name='order[6]' value='4' /> <input type='submit' name='form' /> </form> <?php } else { foreach($_POST['order'] as $key => $val ) { echo "forum id: " . $key . ", forum order: " . $val; echo "<br>"; } } ?> Array ( [order] => Array ( [1] => 1 [2] => 2 [3] => 1 [4] => 3 [5] => 1 [6] => 4 ) [form] => Submit Query ) Thanks I guess.. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 8, 2008 Share Posted March 8, 2008 When you have a statement like this, If I did something like the code above but in another way? how can you expect a specific answer when only you know what "another way" is? I read your post earlier but ignored it for that reason. Quote Link to comment 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.