CURL - 取消选中复选框输入

时间:2015-03-29 11:14:35

标签: php

我正在尝试在表单上发出CURL请求,但我遇到了问题。

这是一个复选框输入代码:

<input type="checkbox" name="encodeURL" id="encodeURL"><label for="encodeURL" class="tooltip" onmouseover="tooltip('Encrypts the URL of the page you are viewing so that it does not contain the target site in plaintext.')" onmouseout="exit();">

如何取消选中此复选框?我试过这样:

$post = 'encodeURL=false';

但它不起作用。

哪里有问题?

1 个答案:

答案 0 :(得分:1)

浏览器不会发送未选中的复选框,即不发送其字段名(并且还会输出值,因为字段名丢失),因为它们不是"successful"。未选中的单选按钮也是如此。

使用fieldname和相关值发送选中的复选框 - 没有HTML中的值,值&#34; on&#34;发送。

Does <input type="checkbox" /> only post data if it's checked?