[thelist] php form radio input array difficulty

John Corry john at neoncowboy.com
Mon Dec 17 16:50:52 CST 2001


I'm in way over my head...
I'm not a programmer at all, but since discovering one of those 'PHP for
beginners' tutorials, I've been pretending :)

I'm working on an app that will let my client edit the contents of a
database. The database is about real estate and I have a form to allow them
to edit 'properties' (not attributes, mind you...the real thing, as in real
property...with an address). Each property has 3-8 photos. I created a
column in my 'photos' table that is a 0/1 flag for whether a photo is
'active' or not (ie: whether it is one of the 2-3 that will display on the
site. So, here's where I lose it:

On the 'edit this property' form, I select all the photos associated with
that property and write image tags for them. I added radio inputs underneath
to allow users to specify whether the photo is active or not. OK...I can't
name all those inputs the same thing. So I appended the 'photo_ID' to each
radio button's name attribute, and now I'm lost...When I submit the form to
the script that will validate and put the fields in the DB, what do I do
with those radio button fields? How do I even know what radio fields I'm
expecting? I sense that this is some sort of array thing, but I can't put it
all together beyond that.
I need to:
 - evaluate the form's variables
 - for each radio button with name+number
	-set the photo_Active to the value of that radio button

How do you do that?

<tip type="phpmyadmin">
I just got the newest version, 2.2.2 If you haven't upgraded yet, you're in
for a TREAT!
http://www.phpwizard.net
</tip>

thanks,
John Corry
Neon Cowboy Design





More information about the thelist mailing list