New at PHP, just need a little help on where I am going wrong!
Trying to get a value from a form to a PHP module which will go to UPS and get rates. I have added a option to include insurance. When I check the value in my UPS PHP module, it is like it is treating it as either true or false meaning something has either been entered or not. Following is my code.
The Form:
<tr>
<td class="contentckout"><b>Select Insurance:* Option</b></td>
<td class="contentckout" width="70%"><input type="hidden" style="color:#FFFFFF; background-color:#333333;" type="text" name="ship_insured" value="">
<SELECT NAME = "ship_insured" style="color:#FFFFFF; background-color:#333333;">
<OPTION VALUE = "">--Select Option--</OPTION>
<OPTION VALUE = "Yes">Yes</OPTION>
<OPTION VALUE = "No">No</OPTION>
</select>
</td>
</tr>
Checking for a required field which is working:
if (!$ship_insured) {
$error_message .= '<br>Missing required field shipping insurance option';
}
Checking to see if I need to request insurance as part of my quote which is not working:
if(!$ship_insured == 'Yes'){
$packageValue = $cart_subtotal;
}
else{
$packageValue = '';
}
Any help would be appreciated!
Thanks!