Jump to content

Select Button Beneath Items Called From Database


sildona

Recommended Posts

I have a file that calls 3 columns (3 products) from a database. Once the information displays, I cannot figure out how to have each column have it's own dropdown menu with some options. Below the dropdown menus, there would also be a "submit" button to process the page and forward the visitor to another page.

 

I know how to forward the visitor (location...)

I know how to carry the session forward

 

Basically, it seems as if I would have to

 

1. call the 3 columns into an HTML form -- do I place the PHP page-loading code into a form frame, so that the information is in the form ???

2. have a drop-down menu appear (or already be in the form) and somehow the 3 columns would each be assigned variables = to those of the drop-down menus (???)

3 have a submit button that would carry the form information to a thank you page while updating the database wit the options selected in the dropdown menus

 

I'm getting confused on this...

 

I don't need sample code ... but if someone could give me the logic / steps necessary to accomplish this and the names of the commands they would use, I could pour through my books and code it.

 

Any help anyone might give -- MUCH APPRECIATED!

 

Thanks!

Link to comment
Share on other sites

Best way would be to have the form created dynamicly by the php code.

here's a summary of how I'd suggest you do it :

 

1- Have php query for the database

2- Grab the product headings from the query into either an array or series of variables

3- Loop through results of the query, assigning each value to a variable that contains <option> elements relevent to a <select> element based on the product heading you just got

4- build the form using the array and/or variables that you have built

5- echo / print onto page

 

Hope that helps.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.