I gave a name to the <select> (so you can access that $_POST variable by it's name in the php script), and I also added a hidden field to the form that will contain the event ID.

By the way, I am big on security, and not so crazy about passing data in the URL since it can be seen and changed.

That is why I am thinking that passing the data using $POST or $SESSION would make the most sense..

In a form you can choose between get and post, so if you don't want to use get, it will be post.Form values are not sent in a session. If you want/need to, you can put them in a session in your php script, AFTER the form has been sent (so from $POST to $SESSION).

By the way, I am big on security, and not so crazy about passing data in the URL since it can be seen and changed.

That is why I am thinking that passing the data using $POST or $SESSION would make the most sense... :-/

What do you think?

With respect, I think you are kidding yourself.

If someone wants to probe your backend, they will do it with a POST form just as easy as a GET form.

I know because I made the same mistake when starting out, and was rightly trounced upon by someone here saying "...security through obscurity is not security!".

Use GET when you feel it is right, ie to fetch information if you don't mind uglier urls. Use POST to update or change information.

When starting out you can sometimes gain a benefit by actually seeing variables appear in your address bar as you develop by starting off with GET, then switch your form and form handler to POST before publishing.

(I remember reading some code once where someone had actually set a variable for their forms so they could do this)

As in all these types of operation, html, js, css, to PHP and Mysql make sure you divide and conquer.

Have a basic html form that works first that sends data to a simple form handler that var_dump()s the data, then model it using PHP to insert the variables where you want them, then have PHP filter and handle the data, then get the data into your db, then add styling, then add behaviours...

It will work as long as you are aware that all of the events will always be posted. Normally, this would be fine. You just loop through and see which event actually has something in the attendees column. However, if the user decides to attend more than one event then you will have to decide if you should let them do that or if you should return an error message indicating that only one event can be selected.

Take the code I posted and mess around with the results a bit. The issues will be clearer.

It will work as long as you are aware that all of the events will always be posted. Normally, this would be fine. You just loop through and see which event actually has something in the attendees column. However, if the user decides to attend more than one event then you will have to decide if you should let them do that or if you should return an error message indicating that only one event can be selected.

Take the code I posted and mess around with the results a bit. The issues will be clearer.

If a user selects Attendees for all 3 Events, then I would have no way of knowing for which Event they clicked the "Buy Ticket" button...

You could give the submit buttons a name (all the same name) and add the EventId as an index to that name (like ahundiak did with the selects). I tested it in FF and IE and it works. That way you can see what button has been pressed.

Can this code be used for Wordpress sites?I'm trying to find a suitable event registration forms widget for a basic WP site, I've searched everywhere, asked in all the WP support boards and still nothing...