SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast thomasfrank09's Avatar
    Join Date
    Jun 2009
    Location
    Ames, IA
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple update box in php

    Hey guys,

    I've been trying to develop a site with a simple box on the sidebar for news. I need it to be simple to update because my client knows nothing about web design. At first I tried to accomplish this through making the entire site in Joomla, but it's turning out to be harder because I'm not familiar with it. So can I code site from scratch, and make a simple form somewhere in the site with a password field (validated so only he can use it) and a textarea, and have whatever is added to the text area be what is displayed in the newsbox?
    I run the blog College Info Geek.

    You can find me at:
    My personal site | Facebook | Twitter | LinkedIn

  2. #2
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you will need to store the news somewhere (unless you want to get them from some RSS feed) - for example a MySQL table.

    You can then create a simple admin area where user can add, edit, delete news.

    What you will need:

    1) a MySQL table
    2) a HTML form for adding and editing news

    That's it, in the frontpage just fetch the news from the database and display the results.

    If you need some code examples, be more specific what part you are having trouble with (database, HTML form, form handling etc) and I will write a simple code snippet for you.

  3. #3
    SitePoint Addict amitjoshi's Avatar
    Join Date
    Jul 2005
    Location
    Oklahoma, USA
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it is really simple text (news) and you dont need to save the last one then you can consider saving the contents that client posts in a .txt file.

    In the index page, you can simply read the content of this file and add it on the news box.

    But if you are already using database for other portions of the site, then make a new table for news and save everything in that table. This is better than using files.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •