Yellow Jacket
Blue Ridge High School
Yellow Jacket
Home > Web Design > Web II > Add Users

Update Page Text




  1. Create a table in your PHPMyAdmin called "pages".
    • Add the following columns:
      • id (type: integer, auto_increment)
      • page (type: varchar(20))
      • text (type: text)
    • Insert the page names and text that coincide with the pages you have created for your site.
  2. Create a new PHP file called "selectpage.php".
    • Use the SQL "SELECT" to retrieve the page names
    • Use a <select> tag to create a drop-down input to choose the page name
    • Use a "WHILE" loop and <option> tag to display the individual page names to choose from.
  3. Create a new PHP file called "editpage.php".
    • Use SQL "SELECT WHERE" to retrieve the page text (using info submitted from step 2) and display inside a form using the <textarea> tag.
    • You will have to "save" the page name and submit it with the updated text.
    • You can use a hidden input with type="hidden" and value="pagename".  The user won't see the page name, but it will be submitted with the form.
  4. Create a new PHP file called "updatepage.php".
    • Update the page text submitted using SQL "UPDATE" and "WHERE" for the page name.
  5. Providing a link to update another page.
  6. Require all users to login prior to accessing any of the pages you have created (selectpage, editpage, or updatepage).
  7. Use your existing company layout for the pages you create.
  8. Validate your form and display page.