[英]Post two values from input field with php
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: 这是我的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 ? 如何使用php获取这两个值?
Create a separate input
for the two 为两者创建单独的input
<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">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.