How to update a text block using PHP?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kidinbed
    New Member
    • Jan 2011
    • 1

    How to update a text block using PHP?

    I'm building a website for a food truck. Their menu changes frequently. I'm trying to build a simple backend page that they can login to and update their menu. I wanted to do this by displaying two pages in iframes in small panes on the actual site. The backend menuadmin page will allow them to type in the new menu, as it changes.

    So I need to know how to use PHP to just print text on a site and have it stay there until new text is submitted. So far I've got the menuadmin page with the two forms for each menu. I've figured out how to post it to the menu pages but the text doesn't stay. I'd also like to know how to keep it on the menuadmin page without it going to the menu pages when you hit submit. I have the pages on the menuadmin page in iframes and I can preview the changes by right click> reload.

    I've never worked with forms really so I hope I've done any of this right.

    http://comp.uark.edu/~cdavies/menu/menuadmin.php
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    You need to store the text somewhere on the server. What it sounds like is you submit the form and the page that displays the menu pulls it from the form submitted-globals (such as GET or POST). That's not really "storing" it anywhere permanently. GET and POST variables get erased with every load.

    You need to save the data to a database or a file. If there is high traffic on the site and it changes frequently, then you definitely need a database.


    Dan

    Comment

    Working...