huddds
huddds

Reputation: 1045

PHP uploading an image with my CMS?

I've built a php CMS and for my news page I want the option to either add one main image or the possibility of multiple images at the bottom for news stories with sponsors etc.

The basic article will have a square image on the left of the main content. I've coded it so the main image on upload is names the same as the article id.

I was thinking of adding an option to my database for 'bottom images' and have an upload option for when this is set to yes.

What would be the best way to go about this? I'm working in php and mysql.

Any help would be great thanks!

Upvotes: 0

Views: 1096

Answers (2)

IvenMS
IvenMS

Reputation: 535

Create a table called:

article_images (id, article_id, image_path, image_type, published, added_datetime)

here, image type will choose what type of image. You can store many rows of image data for a single article. The image type will choose where to put the images: (main image, bottom image, etc...)

Please have a look.

Upvotes: 2

Shameer
Shameer

Reputation: 3066

Best way to do is use any WYSIWYG editor like tinyMCE or CKeditor. You wont need to worry about managing imaging separately.

Upvotes: 0

Related Questions