changing form based on variable

From: Date: Tue, 20 Jul 2010 17:28:00 +0000
Subject: changing form based on variable
Groups: php.general 
Request: Send a blank email to php-general+get-307032@lists.php.net to get a copy of this message
Hello, I've got a form, it's sticky, and it can either display on an insert or update. Depending on whether i'm wanting to do an insert or update the area the form gets it's input changes. So, i've got a name field, if it's set to insert, not sure how to differentiate between the two actions, name gets it's input from the value of $_POST['name'] since it's sticky. If it's set to update that name value is filled in by the name field output in a database. Also, if insert the button for sending the form is called "add" if update it's called "update" I'd like to know how to pull this off, because in both cases the form entry fields are the same, i don't want to have to write two forms when one should work. Thanks. Dave.

« previous php.general (#307032) next »