I am new to php and wanted to make a blog using php where every one can see the contents posted in the site but another administrator page should be there which can edit, add or delete posts
How can i code a page like that? What are the logics required?
-
There are lots of tutorials for this sort of venture around the internet.
I think It may be a bit too much to write in a single answer here.. You're best to choose one of these tutorials or find a book that uses building a blog as a means for learning more about PHP.
-
no1: If you just need a blog software, don't write it yourself, there are tons of free services and applications you can use or adapt
no2: If you want to do this because you want to learn php, go ahead!
no3: Best way of doing this is following a tutorial! 10 seconds of googling is enough and will help you much more than posting a question like that here: http://www.google.ee/search?q=tutorial+php+blog
-
At this stage you have 2 choices.
Learn some basic PHP (which would include databasing, web server management, safe form handling, html, javascript, css etc.) And then implement some very basic blog which would suit your purposes.
Use a prepackaged product like Wordpress, Drupal, or one of the hundreds available. You could perhaps modify it slightly to suit your needs and you would learn PHP in the process.
-
I recommend you do not waste time with learning PHP. You will be very frustrated after two years or so. You will understand that it is not YOU who is limited, but it is the PHP programming language and infrastructure that is putting the limits on you. Go ahead with learning, but learn PYTHON instead! You will have much more freedom and possibilities with Python and in the end you will spend much more time with your dog, your love and your friends than solving computer problems, because you will find nearly every problem already solved within the python community. This is a serious answer, not a joke, to save a young person a lot of lifetime that can be spent much more meaningful than reinventing the wheel.
A blog can be made very easy with a good web framework like web2py.
tharkun : there are loads of reasions for learning python, but there are maybe even more reasons for learning php... there are quite nice posts on SO about this topic.shah.shakthi : is webdevolopment possible with python?i am not aware about it ?dragonmantank : Short answer - Yes, web development is possible with Python. But there isn't any reason to ignore PHP. The strides made over the last few years going OO and the work of Zend have helped moved it toward enterprise and a more stable language for businesses to use. Use the right tool for the job.Pim Jager : wow, this is probably the worst answer I ever read on SOstesch : Thanks, good answer. You got my vote.Aaron Gallagher : Don't let these folks get you down. I +1'd you. -
Internet tutorials are great. You are going to want to consider two main things:
- How you store the data (the posts people write)
- How you present this to the user.
Data:
You could consider databases but this is probably overkill for a learning excersise. Probably simple text files, perhaps one per entry (with a unique naming scheme), or structured XML to store the posts info. You will need to think about indexing each entry in some way so that it can easily be recovered. You will need to consider poerformance implications of your choice, such as file-reads etc. This will not be a problem in a small test site, but you should think about what happens of you had thousands of users as part of the excersise.
Presentation
You will need to look at some css and html to get make displaying the content easily configurable. Think about what componants you want to display, things such as a blog "entry", which you can then programatically put into the html when you serve a page as many times as you need.
-
The workflow that you're looking for is quite simple, with just 2 layers.
- Create/Update/Delete items
- View Items
I'd direct you to nettut's excellent walkthrough on the subject, which goes through all stages of implementation (creation of database objects, queries, etc). It leaves out the beautifying process (it's styleless) which only means that you'll have an even greater amount of freedom. It also tries to conform to an object oriented design, while keeping it simple to avoid making people disencouraged (a blog site can be a large project).
If you're feeling less adventurous they also have an excellent article on making a simple shoutbox
Happy coding.
-
Check out Wordpress:
0 comments:
Post a Comment