Hello All,
I am new to PHP and I am trying to modify a already written script since I want to add a checkbox to my site.
In the front end I have
<input type="checkbox" name="privateurlcheck" id="privateurlcheck" value="0">
in the php I have
var privateurlcheck = document.getElementById( "privateurlcheck" ).value
Then in the mysql data insert php page,
$records[channel_protected] = $postData[privateurlcheck] ;
In MySQL "channel_protected" field is "ENUM" with Values '0','1'
When I run the code I see 0 in the MySQL channel_protected field even when I check the checkbox. All other values that are passed on to mysql such as name, age are posted correctly without any issues.
Can you please let me know how can I get 0 or 1 in the mysql depening on the checkbox status?
It is 5AM and I am trying to figure this for 2nd consecutive day! Greatly appreciate if any one can help me out.