biffjo Posted January 5, 2007 Share Posted January 5, 2007 So I have a form, and the radio boxes are filled out by a database query with database generated names.example:[code]<input type="radio" name="gid2" value="16"> Foo<input type="radio" name="gid2" value="17"> bar<input type="radio" name="gid456" value="1"> Foo<input type="radio" name="gid456" value="7"> bar//there could be lots more, don't know how many...[/code]How do I get [b]all the variables[/b] upon a post when I don't know all the names? Quote Link to comment https://forums.phpfreaks.com/topic/32927-solved-form-post-with-unknown-form-variable-names/ Share on other sites More sharing options...
effigy Posted January 5, 2007 Share Posted January 5, 2007 They'll be in the $_POST array. Quote Link to comment https://forums.phpfreaks.com/topic/32927-solved-form-post-with-unknown-form-variable-names/#findComment-153316 Share on other sites More sharing options...
kenrbnsn Posted January 5, 2007 Share Posted January 5, 2007 All the values are returned to your script in the $_POST superglobal array. I would use a foreach loop:[code]<?phpforeach ($_POST as $key => $value) {//// do the work//}?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/32927-solved-form-post-with-unknown-form-variable-names/#findComment-153317 Share on other sites More sharing options...
biffjo Posted January 5, 2007 Author Share Posted January 5, 2007 Ah, thanks, now at least I know what to search for. Thanks! ;D Quote Link to comment https://forums.phpfreaks.com/topic/32927-solved-form-post-with-unknown-form-variable-names/#findComment-153318 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.