Need help with php code!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Need help with php code!

Post by benji2010 »

Hello everyone,

Before I start, please forgive me if this seems simple to you. I am new to php and mysql.

I am setting up a e-commerce site and so far it is going very well but I have now hit a bit of a road block and need some help.

Two questions really. I have created my own simple CMS so I can load up html product pages without having to create new product pages!

1, In the CMS how do I have the option to place a drop down with 3 different colours. For example product 1 has 'black and 'white' whereas product 2 only has 'Brown' and product four has 'yellow and pink'. How would I in the CMS be able to write code that the admin could choose these for the specific products.

2, How would I go about having a size and colour drop down on an item and how would that work with php?

How would all of this work together?

Thanks for any help that I get!

Ben. :D
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

Can anyone please help me?

Thank you :)
litebearer
Forum Contributor
Posts: 194
Joined: Sat Mar 27, 2004 5:54 am

Re: Need help with php code!

Post by litebearer »

Show us the coding you have tried thus far
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

Hi,

I haven't fully written the code for the cms as yet. What I need to know is how would I go about this?

How would I in the CMS be able to write code that the admin could choose these for the specific products?

Thanks,

Ben.
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

Can anyone help me? Please?
klandaika
Forum Newbie
Posts: 19
Joined: Wed Mar 30, 2011 3:25 pm
Location: New York

Re: Need help with php code!

Post by klandaika »

What do you use to store you product information no? database or some other method?

if it is a database then what you would have to do is probably create another table where you woudl store the information about available options for each of your products.
Then on the display page you would create dorpdown boxes based on the data in the options table that corresponds to the item being viewed.

For administrator to be able to modify the options you would have make a either an admin page or a form which display only to administrator on the products page, upon submission a row would be added/deleted/modified when the administrator adds/deletes/modifies an option of the item.
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

Hey,

I think that i figured it out. Basically I am going to have several pages with which have different includes files. So one includes file will have a colour option of blue, one red and another pink. So I just got to have different admin panel options, with different form in the includes files.

Would this sound about right to anyone?

Thanks,

Ben.
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

So what do people think?

Would this work?
klandaika
Forum Newbie
Posts: 19
Joined: Wed Mar 30, 2011 3:25 pm
Location: New York

Re: Need help with php code!

Post by klandaika »

This isn't a traditional way of making product pages with custom options. It might work out for you, but changing things later on might get quite difficult.
benji2010
Forum Newbie
Posts: 12
Joined: Fri Apr 01, 2011 1:41 am

Re: Need help with php code!

Post by benji2010 »

So how would one go about it?

I am stuck and need all the help I can get.

Thanks,

Ben.
Post Reply