From: David Mehler

> What i'm trying to do certainly doesn't seem hard conceptually, but
> coding it has been rough. I'm wondering if anyone has anything
> similar.
> I've got a database with records. The first time the page is accessed
> the submit button won't be selected, so display information about the
> record with a checkbox for selection. If a user selects a checkbox and
> hits submit, display only that specific record in a form for editing,
> once editing is complete feed the edited data back to the database.
> I'd like all this to be done in a single sticky file.
> If anyone has any code similar to this i'd appreciate getting a look,
> mine is nonworking.

Mine looks something like this

-----8<-------------------------------------------
    $Submit   = $_POST['Submit'];

    if (isset($CCsubmit)) {
        ////////  DELETE
        if ($Submit == "Delete") {
            // Check to see if user authorized, then delete record

        }
        ////////  NEW
        else if ($Submit == "New" || $Submit == "Next"){
            // Issue empty form or next record

        }
        ////////  EDIT
        else if ($Submit == "Save") {
            // Validate and ssve the updated data. Reissue if validation
fails.

        }
    }
    else {
        // Issue form with initial data



    }
-----8<-------------------------------------------

You should also check in the Save option to see if anything was actually
changed. The record shouldn't be updated if nothing was edited.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to