Page 1 of 1

NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 9:46 am
by nithinkk
I want to build a php page where a user can upload images and text for the web page. Just like CMS. Is there any in build code which i can use to build this news Event updater. With news event updater my manager wants to update the latest news. Can any one help me / suggest what's the best way to do it ? I'm not that much expert in php so i want help from your side ? Can any one help me ?

Re: NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 9:57 am
by John Cartwright
This is more of a request for people to write code for you than it is asking a specific question.

My answer: Actually use a CMS that may have this functionality built in. There is no "prebuilt" code in PHP for such things, thats what programming is for :D

Re: NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 10:03 am
by nithinkk
Its not a request to write the code for me !!! I just want to know the best way of doing it from experts before i start ! I can't use CMS for this.

Re: NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 10:06 am
by John Cartwright
nithinkk wrote:Its not a request to write the code for me !!! I just want to know the best way of doing it from experts before i start ! I can't use CMS for this.
We'll it's tough to give you an answer without writing code.

1) Do you know how to handle forms?
2) Do you know how to validate data?
3) Do you know how to a manipulate database, i.e., inserting, updating, deleting data

Re: NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 10:15 am
by nithinkk

Code: Select all

We'll it's tough to give you an answer without writing code.

1) Do you know how to handle forms?
2) Do you know how to validate data?
3) Do you know how to a manipulate database, i.e., inserting, updating, deleting data

Code: Select all

MY Answer to your question is a BIG YES !!!
Hey man ! Taking suggestion is always good ! Bcoz here i can find more PHP experts who have done same kind of work. So before doing it ask'g will help me in many ways....i can learn from others mistakes not mine :-)

Re: NEWS Event in PHP !!!

Posted: Fri Jan 21, 2011 10:21 am
by John Cartwright
nithinkk wrote:

Code: Select all

We'll it's tough to give you an answer without writing code.

1) Do you know how to handle forms?
2) Do you know how to validate data?
3) Do you know how to a manipulate database, i.e., inserting, updating, deleting data

Code: Select all

MY Answer to your question is a BIG YES !!!
Hey man ! Taking suggestion is always good ! Bcoz here i can find more PHP experts who have done same kind of work. So before doing it ask'g will help me in many ways....i can learn from others mistakes not mine :-)
Yes I completely agree that seeking alternate perspectives on a project is an excellent idea. But what you are asking is extremely vague. I can't answer your question without writing and citing specific examples, which would basically mean I'm writing the entire thing for you (since it's quite basic).

So to answer your vague question with a answer(s)

1) Validate all your data
2) Escape all your input when dealing with MySQL queries (mysql_real_escape_string())
3) Escape all your input when displaying in HTML (htmlentities())
4) Make sure you define server limits on sizes of images to upload, otherwise you are vulnerable to disk issues
5) If possible, re-draw the image using GD and save that image to guarantee no malicious code is in the images
6) Store the images on a filesystem and set up your images dir as chmoded to 644 permission
7) Store the image id in the database which references the path

That's all I can really offer without you asking specific questions, sorry. I'll be more than happy to help if you can provide specifics.