Search Form Problem

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
Hello everybody,

I'm a newbee to php and have (I think) a fairly easy question.

I've developed a search form wich takes all descriptions out of a table and puts them dynamicly on the form:
<input type="checkbox" name="description$temp" value="description">
$temp is a variable wich changes everytime he loops trough te while.

My problem is the following: I need a way to confirm if a checkbox is checked and after i've got them all, I need to search them in a different table. Sounds Complicated ?! :?

I hope someone got the answer for me.............

Greetz Helgo Rongen.

P.S. if you need further details regarding the question, I will gladly give them to you.
 
It's easier if you use the name as an array, eg name="description[]", then on your action page you'll get an array called name which you can loop through to give you all the tables!
 
Hmmzzzz, sounds good to me.

But how do I use arrays with php, do I need to declare somewhere that it's an array?!

And how can I run trough them on the action page to see if the checkbox is checked or not?!

Greetz Helgo.
 
You don't need to declare variables in PHP. Only the checked elements will appear in the array (so anything that's not there obviously wasn't checked!)
 
Thanks a million, it works like a charm......... :D

Greetz Helgo.
 
Jay,

Now that this works, I have another problem wich is related to the previous........but because it's a problem with a mysql query, i posted it in the mySQL & php coding forum. I think (for the expert) it must be easy to solve.

My question: would you be so kind to see if you know the answer to that problem.........I really need the answer, because I can't go on without it.

Greetz Helgo Rongen.

P.S. Would I doubt people who give me the right answers?! 8)
 
Back
Top