trampolinejoe Posted November 29, 2008 Share Posted November 29, 2008 Hello, I have a form that has some check boxes for example: <form action="paymentMark.php" name="form"> <input name='checkbutton[]' type='checkbox' value='1'> <input name='checkbutton[]' type='checkbox' value='2'> <input name='checkbutton[]' type='checkbox' value='3'> </form> Then on the next page paymentMark.php $checkbutton = array(); $checkbutton = $_POST['checkbutton[]']; print_r($checkbutton); Nothing is showing in the array, and even more strangely, it is trying to post in the URL. Here is a example: paymentMark.php?checkbutton[]=1&Submit=Submit+Query Why is this showing in the URL it normally dosnt when you just post? Any ideas. Quote Link to comment https://forums.phpfreaks.com/topic/134748-solved-multiselect-form-to-array-post-is-displaying-in-url-strange/ Share on other sites More sharing options...
.josh Posted November 29, 2008 Share Posted November 29, 2008 that's because you didn't specify posting method in your form, so it defaults to the GET method (through the url). Add method='post' to your form tag Quote Link to comment https://forums.phpfreaks.com/topic/134748-solved-multiselect-form-to-array-post-is-displaying-in-url-strange/#findComment-701689 Share on other sites More sharing options...
trampolinejoe Posted November 29, 2008 Author Share Posted November 29, 2008 thanks for that Quote Link to comment https://forums.phpfreaks.com/topic/134748-solved-multiselect-form-to-array-post-is-displaying-in-url-strange/#findComment-701858 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.