-1

I'm trying to make a CURL request on form but I have a problem.

Here is a checkbox input code:

<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();">

How I can uncheck this checkbox? I tried like that:

$post = 'encodeURL=false';

But it doesn't work.

Where is a problem?

Newester
  • 1,457
  • 2
  • 14
  • 26

1 Answers1

1

Unchecked checkboxes are NOT sent by the browser, i.e. their fieldname is NOT sent (and the value also, because the fieldname is missing), because they are not "successful". The same is true for unselected radio buttons.

Checked checkboxes are sent using the fieldname and the associated value - without a value in HTML, the value "on" is sent.

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

Community
  • 1
  • 1
Sven
  • 69,403
  • 10
  • 107
  • 109