为什么以及何时使用输入类型隐藏?

时间:2016-01-02 18:11:49

标签: javascript html

任何人都可以解释这个领域,为什么使用它以及如何解释????

if($category == 'A') {
    // A category rules:
    $final_url = str_replace(array('aaa', '?url'), array('bbb', '?id=' . $id . '&url'), $url);
    $re = "/(?<=TID%3D)\\d+/";  // replace rule for current case
    if($offer == 'Special') {
        //category is A and offer is special
        $tid = "123"; // Default New TID value for current case
        if ($discount == '10') {
            // category is A, offer is special, and Discount is 10
            $tid = "999"; // Special TID value for current case
        }
       $final_url = preg_replace($re, $tid, $url3);
    }
}

1 个答案:

答案 0 :(得分:1)

用于在提交表单时将数据传递到服务器。数据位于value属性中。由于它是隐藏的,用户无法看到它,但服务器会获得有关表单的额外信息。