rozebiz wrote:
> I've used DW insert app object to build form to update a
record. I'd like to
> add an if statement but I am unsure where to insert the
code. I want to check
> a field for a specific value before letting the record
be updated. If the value
> is equal to a specific value the form is process
otherwise the entire update is
> cancelled.
The PHP code that controls the update begins with this line
("form1"
will be whatever name the update form has):
if ((isset($_POST["MM_update"])) &&
($_POST["MM_update"] == "form1")) {
Place your cursor at the end of that line and press enter a
couple of
times to insert space for the following code:
if ($_POST['myVariable'] != 'required_value') {
// code to inform user that update has not been done
}
else {
Then scroll down until you find this code:
header(sprintf("Location: %s", $updateGoTo));
}
Insert another closing curly brace immediately after it to
balance the
opening one after "else".
Replace 'myVariable' and 'required_value' with the field that
you want
to check and the value it needs to be.
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/