Add Checkbox value to salesforce
<p>im new to salesforce integration.</p>

<p>i have a contact form in which i have a field called Optin/Optout filed which is checkbox. if the user tick that checkbox value should get captured in salesforce. but i could not do it. can anyone please help me in this.</p>

<p>here is my code what i have done so far.</p>

<p>index.php</p>

<pre><code>&lt;form action="salesforce.php"&gt;

&lt;input type="checkbox" name="news" value="1" checked="checked"/&gt;

&lt;/form&gt;
</code></pre>

<p>salesforce.php</p>

<pre><code>&lt;?php
$newsletter = $_POST['news'];

if($newsletter == "1"){
$news_result = $newsletter;
}else{
$news_result = "0";
}


$req .= "&amp;HasOptedOutOfEmail=" . urlencode($news_result);

?&gt;
</code></pre>
