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
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.

Link to comment
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.

 

If you're trying to get '$_POST['name12']', why not just do $_POST['name12'] ? i mean, name12 is the name of the checkbox.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.