0

I have some registration which sends tag as a value to the server

<input type="hidden" id="tag-sm" name="tag-sm" value="workshops_10.2017">

Now I must send two different tags

<input type="hidden" id="tag-sm" name="tag-sm" value1="workshops_10.2017" value2="events">

this is my php:

$obj = array(
   'first-name' => htmlspecialchars($_POST['first-name']),
   'last-name' => htmlspecialchars($_POST['last-name']),
   'email' => htmlspecialchars($_POST['email']),
   'phone' => (isset($_POST['phone'])) ? 
   'tag' => htmlspecialchars($_POST['tag-sm']),
   'discount-codes' => (isset($_POST['discount-codes'])) ? 
);

how to get these two values with php ?

krzystov_k
  • 11
  • 1
  • Check out this question https://stackoverflow.com/questions/8027163/how-to-post-two-values-in-an-option-field – Sean Konig Oct 12 '17 at 08:57
  • Possible duplicate of [How to post two values in an option field?](https://stackoverflow.com/questions/8027163/how-to-post-two-values-in-an-option-field) – Aaron Thompson Oct 12 '17 at 09:01

1 Answers1

0

Create a separate input for the two

<input type="hidden" id="tag-sm-1" name="tag-sm-1" value="workshops_10.2017">
<input type="hidden" id="tag-sm-2" name="tag-sm-2" value="events">
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46