Search Form Problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Wacko2019
New php-forum User
New php-forum User
Posts: 16
Joined: Sun Oct 27, 2002 10:18 am
Location: Netherlands

Search Form Problem

Postby Wacko2019 » Tue Oct 29, 2002 1:25 am

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.

Jay

Postby Jay » Tue Oct 29, 2002 6:02 am

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!

Wacko2019
New php-forum User
New php-forum User
Posts: 16
Joined: Sun Oct 27, 2002 10:18 am
Location: Netherlands

Postby Wacko2019 » Tue Oct 29, 2002 7:05 am

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.

Jay

Postby Jay » Tue Oct 29, 2002 7:45 am

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!)

Wacko2019
New php-forum User
New php-forum User
Posts: 16
Joined: Sun Oct 27, 2002 10:18 am
Location: Netherlands

Postby Wacko2019 » Tue Oct 29, 2002 7:55 am

Great thanks, I will try this tomorrow ;)

Greetz Helgo.

Wacko2019
New php-forum User
New php-forum User
Posts: 16
Joined: Sun Oct 27, 2002 10:18 am
Location: Netherlands

Postby Wacko2019 » Wed Oct 30, 2002 1:42 am

Thanks a million, it works like a charm......... :D

Greetz Helgo.

Jay

Postby Jay » Wed Oct 30, 2002 1:53 am

Wacko2019 wrote:Thanks a million, it works like a charm......... :D

Greetz Helgo.

Of course it did, you didn't doubt me, did you ;)

Wacko2019
New php-forum User
New php-forum User
Posts: 16
Joined: Sun Oct 27, 2002 10:18 am
Location: Netherlands

Postby Wacko2019 » Wed Oct 30, 2002 4:24 am

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)


Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest