Jump to content

help with a html posting variable issue


mgwalk

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/130764-help-with-a-html-posting-variable-issue/
Share on other sites

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.