I cannot find any answers on the following issue.
On my website I would like to have a chackbox with id="filter".
The checkbox is needed to allow users choose between “moderated” and “all other” content e.g. if checkbox is checked show “moderated” content, if checkbox is un-checked show “all other content” .
I have 2 different mySQL queries for conntents:
Moderated Content
$moderated_content = mysql_query("SELECT * FROM articles WHERE showing=1");
All Other Content
$allOther_content = mysql_query("SELECT * FROM articles");
Therefore I would like to use these different queries depending on a state of checkbox. I have a cookie that remembers if user has checked or un-checked a checkbox. And I can show different content when they visit the website.
And here is the problem. Say user is already on the webpage and his/her checkbox is unchecked, so they than decide to check a checkbox. How can I show new content after they checked it? I’d like to use AJAX, but I’m not good with it, so the best solution for me would be a page refresh I guess.
Thank You
you can check the value for checked like for example ,
and you would check if its isset so you dont get any notices