The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
I have a basic php flatfile search script that I'm trying to modify.
The script works fine for visitors using a free form search but I would like to add some form checkboxes to make it friendlier.
The script uses a variable called 'keyword'.
The freeform search passes single or multiple search terms successfully but the FORM i'm attempting to use with checkboxes only makes use of the last selection.
The form I've created uses duplicate names - 'keyword'
<input type="checkbox" name="keyword"
value="hosting"
<input type="checkbox" name="keyword" value="broadband">broadband
In my ham fisted way I've read that I can change this to
"keyword[ ]"
and this should create an array. When I try this the script ends up searching for Array ! You can see the problem/code here:
www.hmmm.ip3.co.uk/searchtesting
Using FORM 1 searching for 'hosting broadband' only returns Freeola in the results.
Using FORM 2 selecting both hosting and broadband the script only searches for broadband - only picking up the last keyword.
Any help changing the FORM and/or script would be appreciated :¬)
Thanks.
[s]Hmmm...[/s]
I'm hoping you're still waking up... :¬)
That's giving me: "No results for Array." at the moment.
www.hmmm.ip3.co.uk/searchtesting/garin.php
[s]Hmmm...[/s]
I only just started learning PHP and MySQL. It's quite enjoyable, but I think I need Garin or Eccles to explain Bitwise operations for me.
$keyword = $_POST['keyword'];
put..
if (is_array($keyword)) {
$keyword=implode(' ',$keyword);
}
I only just woke up so thats looks right but it might not be. :p
I have a basic php flatfile search script that I'm trying to modify.
The script works fine for visitors using a free form search but I would like to add some form checkboxes to make it friendlier.
The script uses a variable called 'keyword'.
The freeform search passes single or multiple search terms successfully but the FORM i'm attempting to use with checkboxes only makes use of the last selection.
The form I've created uses duplicate names - 'keyword'
<input type="checkbox" name="keyword"
value="hosting"
<input type="checkbox" name="keyword" value="broadband">broadband
In my ham fisted way I've read that I can change this to
"keyword[ ]"
and this should create an array. When I try this the script ends up searching for Array ! You can see the problem/code here:
www.hmmm.ip3.co.uk/searchtesting
Using FORM 1 searching for 'hosting broadband' only returns Freeola in the results.
Using FORM 2 selecting both hosting and broadband the script only searches for broadband - only picking up the last keyword.
Any help changing the FORM and/or script would be appreciated :¬)
Thanks.
[s]Hmmm...[/s]