0

Hi Everyone.

I have a page were I need to give the viewer the option to add their choice to a shortlist. Is it possible to do this in a pure PHP / MySQL environment?

Regards

4
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by ronty2010
0

Hi LRNPHP,
I am a little unsure as to what you are actually asking here.
If you have a list of items (for example apples, oranges and pears) you could store the list in a database and then add the users choice (for example bananas) to the list with very simple PHP & MySQL.

Do you have a specific example?


Zagga

0

Hi LRNPHP,
I am a little unsure as to what you are actually asking here.
If you have a list of items (for example apples, oranges and pears) you could store the list in a database and then add the users choice (for example bananas) to the list with very simple PHP & MySQL.

Do you have a specific example?


Zagga

Hi Zagga.

I have a site that I'm running with PHP / MySQL. He will do a search for what he want's (all the info is being pulled from the DB and displayed). On the search results page it will give him a option to add up to 5 search results to a shortlist that he can email to himself and me.

Hope it is understandable. Thanks Again.

Regards

0

Read the info from the db into a form where each item each has a checkbox. You will give each item a standard name plus an index number (i.e. name=aaaa$i). In the module that processes the form data, you process the items one at a time in a loop treating them as variable variables and then copying them to a standard variable name that the rest of the processing uses. You could add each of the chosen items to a string and when you're done, insert that string into an email that you send to him and to yourself. All of this is pretty straightforward PHP. If you haven't used variable variables you might find it a bit confusing but the actual code to do it is quite simple.

With respect to "pure PHP and MYSQL" the only considerations come in if the list of items is to be paginated because it is too long for one page; or, if you want to be able to limit him to 5 items as they are being chosen. In both cases, you might want some javascript but it could be handled in a less elegant way with PHP.

0

Shortlist????What it means?????????What are you going to shortlist???????
-------------------------------------------------------------------------------------

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.