Hello friends,i need your help in PHP.Currently i am doing a module named compare items,in which i have to compare different phones of different brands.

Working of this module:
firstly user check the associated checkbox of the phone.At a time user can Select 3 phones.A list is maintained which keep the record of selected phone.also delete(remove)
option should be there in list for selected items.
same as below link:
SNIP

Waiting for Response.

Recommended Answers

All 6 Replies

I a phone was an object you could keep them in session and if the visitor wants to compare them then you should have a compare algorithm (you are comparing them in some logic). If it is easier for you a “phone” can be also a table row php array (almost an object) and you can then compare them.

AS I am fetching phone id from database & storing these values in checkbox's value attribute. If user select three checkboxes from 10 records then how i can store in to an array (If user clicks a particuler checkbox then value must be stored in array & if unselect then vice-versa)
can u please give me some code or relative link

You are not storing these values in checkbox's value attribute, this is only view. Not talking about optimization (You have already got the results so there is no need to get them second time) the only thing you need is the ID of “phone” the visitor puts for comparison.

Member Avatar for diafol

You've posted this before. Why do you insist on people visiting the site - are you getting a kickback? Post your code HERE like everybody else.

Sorry for the duplicate post.I am new in php & also using your forum first time.

Member Avatar for diafol

OK, so post the code you have produced so far. That's how it works. Outline the problem and supply your code. Then, if you're lucky somebody can point you in the right direction. Don't ask somebody to write code for you. That's your job.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.