mgwalk Posted October 30, 2008 Share Posted October 30, 2008 I have a field like this the 12 is an item id attached to the name field I want to pick it up on the post. <input type="checkbox" name="name12" value="12" /> When I submit it I try if(isset($_POST['name'.$myid])) // <-- this never is works always not set... { // I can not get here even if the name12 is set... } else { // I always get here } What am I doing wrong or how do you get this to work. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/ Share on other sites More sharing options...
DeanWhitehouse Posted October 30, 2008 Share Posted October 30, 2008 That made no sense at-all, but were is $myid defined, etc. we need to see proper code. Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/#findComment-678637 Share on other sites More sharing options...
mgwalk Posted October 30, 2008 Author Share Posted October 30, 2008 I am trying to get isset($_POST['name'.$myid]) I am getting not set here, when I know it is set. How do you write this? $myid is an item ID it is pulled ok I verified that. I trying to get this isset($_POST['name12']) with my variable. but I now think my error is because my input checkbox (name12) is dynamically created and not posting the field with the form. Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/#findComment-678643 Share on other sites More sharing options...
mgwalk Posted October 30, 2008 Author Share Posted October 30, 2008 it is not seeing my dynamic input (checkbox). Is it possible to post a dynamic checkbox written after the page has loaded? I used Javascript to create these checkboxes from data brought back from XMLHttpRequest(). Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/#findComment-678661 Share on other sites More sharing options...
play_ Posted October 30, 2008 Share Posted October 30, 2008 I am trying to get isset($_POST['name'.$myid]) I am getting not set here, when I know it is set. How do you write this? $myid is an item ID it is pulled ok I verified that. I trying to get this isset($_POST['name12']) with my variable. but I now think my error is because my input checkbox (name12) is dynamically created and not posting the field with the form. If you're trying to get '$_POST['name12']', why not just do $_POST['name12'] ? i mean, name12 is the name of the checkbox. Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/#findComment-678670 Share on other sites More sharing options...
DeanWhitehouse Posted October 30, 2008 Share Posted October 30, 2008 I beleive it is dynamic, but still the if statement seems pointless if it is, so it must be hard coded. Still without seing his code it is impossible to guess. Quote Link to comment https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/#findComment-678672 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.