I'm currently working on a website for recipes that allows users to search by ingredients they have and I'm experiencing a problem with my filtering. My site allows users to just check the checkboxes of ingredients they have. I've been in and out of every forum I can find on the internet any solution and this forum has been pretty helpful! I'm using PostNuke for my CMS & the bulk of my program is run through Pagesetter. I can get my simple commands to work but when I add multiple ingredients to my search I can't get it to filter all the categories. I have my recipes broken down in 6 different categories that go into my db, eg meats1, meats2, fruits1, fruits2 etc. Sample of the code:
[code=html]
<input type="checkbox" name="food[]" value="6">Pork< br>
<input type="checkbox" name="food[]" value="163">Gro und Beef<br>
<input type="checkbox" name="food[]" value="164">Dee r Beef<br>
<input type="checkbox" name="food[]" value="165">Mea t Balls<br>
<input type="checkbox" name="food[]" value="166">Roa st Beef<br>
[/code]
Each ingredient is stored as a number that the pagesetter module determines. I have figured out that 1-20 & 40-26 are meats and so on but can't figure out how to apply it to php to run if statements & to change $cata below for the db field that the ingredient is in, but will only be that field once per search:
[code=html]
<input type="hidden" name="filter1"
value="$cata[]:like:$food[]" />
<input type="submit" value="Update">[/code]
The filter 1 would also need to be changed per ingredient clicked, filter2, filter3. The module pagesetter itself will use long urls to relay the info:
http://www.clickncook. com/PostNuke/index.php?modul e=Pagesetter&fi lter1=meat1:lik e:1&filter2=mea t2:like:2
I've been banging my head on my desk for the past month trying to figure out what I'm doing wrong, and what I need to do to correct it. Example of it can be seen at :
Sorry for the long first time post but any help, or steering in a direction is greatly appreciated.
Martin Curry
[code=html]
<input type="checkbox" name="food[]" value="6">Pork< br>
<input type="checkbox" name="food[]" value="163">Gro und Beef<br>
<input type="checkbox" name="food[]" value="164">Dee r Beef<br>
<input type="checkbox" name="food[]" value="165">Mea t Balls<br>
<input type="checkbox" name="food[]" value="166">Roa st Beef<br>
[/code]
Each ingredient is stored as a number that the pagesetter module determines. I have figured out that 1-20 & 40-26 are meats and so on but can't figure out how to apply it to php to run if statements & to change $cata below for the db field that the ingredient is in, but will only be that field once per search:
[code=html]
<input type="hidden" name="filter1"
value="$cata[]:like:$food[]" />
<input type="submit" value="Update">[/code]
The filter 1 would also need to be changed per ingredient clicked, filter2, filter3. The module pagesetter itself will use long urls to relay the info:
http://www.clickncook. com/PostNuke/index.php?modul e=Pagesetter&fi lter1=meat1:lik e:1&filter2=mea t2:like:2
I've been banging my head on my desk for the past month trying to figure out what I'm doing wrong, and what I need to do to correct it. Example of it can be seen at :
Sorry for the long first time post but any help, or steering in a direction is greatly appreciated.
Martin Curry
Comment