S
|
spoilar 6/1/2007 |
don't know if this is the problem, but try using the comparison operator == if ($Region == "Central") { $email="centraltest@test.com; $message="New Bid Request Posted For the Central Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); } elseif ($Region == "East") { $email="easttest@test.com $message="New Bid Request Posted For the East Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); }else ($Region == "West") { $email="westtest@test.com $message="New Bid Request Posted For the west Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); } |
W
|
wildwally author 6/1/2007 |
Nope still get "Parse error: syntax error, unexpected '{' in D:\Program Files\PHPRunner4.0\projects\myprojectname\_bid_request_events.php on line 42" |
S
|
spoilar 6/1/2007 |
try this if ($Region == "Central"){ |
W
|
wildwally author 6/1/2007 |
Getting closer i believe function BeforeAdd(&$values) { // Parameters: // $values - Array object. // Each field on the Add form represented as 'Field name'-'Field value' pair //** Insert a record into another table **** global $conn; $strSQLInsert = "insert into _activerequest (Request_Date, Quick_Pen_Due_Date, Region, Branch_Location, Store_Name, Store_Number, Store_Location, State, Branch_Manager, Email, Store_Type) values ( '".$values['Request_Date']."', '".$values['Quick_Pen_Due_Date']."', '".$values['Region']."', '".$values['Branch_Location']."', '".$values['Store_Name']."', '".$values['Store_Number']."', '".$values['Store_Location']."', '".$values['State']."', '".$values['Branch_Manager']."', '".$values['Email']."', '".$values['Store_Type']."' )"; db_exec($strSQLInsert,$conn); if ($Region == "Central"){ $email="centraltest@test.com"; $message="New Bid Request Posted For the Central Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); }elseif ($Region == "East"){ $email="easttest@test.com"; $message="New Bid Request Posted For the East Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); }elseif ($Region == "West"){ $email="westtest@test.net"; $message="New Bid Request Posted For the west Region."; $subject="New Bid Request Posted"; mail($email, $subject, $message); } return true; // return true if you like to proceed with adding new record // return false in other case } |
![]() |
Sergey Kornilov admin 6/1/2007 |
If Region is the field name you need to use $values["Region"] instead of $Region. |
W
|
wildwally author 6/1/2007 |
That did it thanks for your help |