I've added check boxes to my install of geeklog (To the Account info, view profile pages.) that relate to the database with values of 1 or 0 (true/false...checked/unchecked.)
The files I've edited are:
usersettings.php-> I use this page for my query and to process the data. profile.thtml is were the checkboxes are written.
The code to check and write the 'checked' attribute are:
if ($A ['sports']== '1')
{
$preferences->set_var ('sports_value', 'checked');
}
else
{
$preferences->set_var ('sports_value', '');
}
'sports' is the database result from the query, sports value will be show below (It comes from profile.thtml)
<td><input type="checkbox" {sports_value} name="sports" value="{sports_num}">Sports
Where sports_value was already listed and sports_num = database query of sports. (Again 1 is checked, 0 is unchecked.)
I'm having problems when I modify the user settings page. If you have the value of sports come back checked, and you uncheck the value how do you save that value?
In my head I see how the page is written/parsed to make the page, but once you try to save the page how do I grab the value of the checkbox and save it back to the database?
Any help is greatly appreciated.
figured it out.