This topic is locked
[SOLVED]

 Help with If statement

3/31/2015 8:08:24 AM
PHPRunner General questions
B
bcritchley author

I am using PHPrunner latest version and was hoping someone could help me with a small piece of code for the edit page section. I would like to have an if statement that looks to see if one field is checked (equal to '1') and is so then send a simple email and then after the simple email I want to set the value of the original checkbox above to '0' and then set the value for a second checkbox to '1' and then end the if statement. I do not need any thing done if the first checkbox is false (equal to '0'). I was going to plug this code into the After record update section of my edit page.
Any help appreciated.

Sergey Kornilov admin 4/4/2015

You can try something like this:

if ($values["field1"]==1) {

// send simple email here

$values["field1"]=0;

$values["field2"]=1;

}