Menu
Below is code that I only want to set the value of $location if the checkbox is checked.
[code=php]
<input name=”location” type=”text” id=”location” style=”margin:.5em;” value=”<?php echo $_SESSION[‘city’].’ ‘.$_SESSION[‘province’]; ?>” />
</span></td>
<td class=”rightTwoColumn” style=”width:5%;”><input name=”checkbox_location” type=”checkbox” id=”checkbox_location” value=”locationTrue” /></td>
</tr>
// script to test if checked
if($checkbox_location == “locationTrue”){
$location = $_POST[‘location’];
}