Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

PHP records page design question

Options
  • 16-12-2009 5:59pm
    #1
    Registered Users Posts: 462 ✭✭


    Im looking to do a simple intranet in the office that can be used to access/modify MYSQL DB records. My question is what is the best practice for programming a records page and its different modes eg create, edit, delete, validate etc.

    I was thinking of doing one page staff.php with a switch statement working off a URL variable for the mode ie ?mode=create, ?mode=edit. Each section of the switch would then be programmed for each of the options create, edit, delete.

    I also need modes for validate (for validating entered data), confirm (for confirmation to delete a record), insert (for creating new records in the DB), update and remove (for deleteion from DB). I would then use another URL variable 'return' to tell the page where to go if theres trouble ie if when validating data and error is found 'return' to edit mode or 'return' to create mode.

    Is this a good way of doing this page and keeping it neat and logical or is there a better way. The only downside I can think of is any HTML code for each pages text and forms will have to be printed with echo statements and therefore have lots of '\'s put in to cater for quotes.


Comments

  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    If your creating a html table populated with data from the database, your only going to need to use a few loops. Your method seems fine, just don't have any logic mixed with the html.


Advertisement