View Full Version : Problems with ifcond in Form Processor Pro

09-01-2006, 08:04 AM
I'll make this gentle...

I'm using a script called form processor pro (Homepage) http://www.email-form.com/ I'm using the php version thus is why I am posting here.

Well it seems that it is possible to use a Ifcond in between your form tags to set and change field values etc. This is what I'm trying to do:

<form name="newsletter" method="POST" action="formprocessorpro.php">
<select name="subscribe" style="position:absolute;left:434px;top:365px;width:100px;z-index:110">
<option value="1">Subscribe</option>
<option value="0">Unsubscribe</option>
<ifcond (([subscribe] == [1]), ([_browser_out = subscribe.html]),([_browser_out = unsubscribe.html]))>
<ifcond (([subscribe] == [1]), ([_send_email1 = emailin-subscribe.txt]),([_send_email1 = emailin-unsubscribe.txt]))>
<ifcond (([subscribe] == [1]), ([_send_email2 = emailout-subscribe.txt]),(_send_email2 = emailout-unsubscribe.txt]))>
<input name="re_subemail" type="text" style="position:absolute;width:200px;left:384px;top:304px;z-index:112">
<input name="submit" type="submit" value="Subscribe/Unsubscribe" style="position:absolute;left:383px;top:402px;z-index:114">

I'm trying to set the browser out page and what emails are sent by the choice of the user in the drop down menu to subscribe or unsubscribe to our newsletter. The _browser_out and the email entries are all passed fields I'm trying to change.

I don't think the syntax of the ifcond lines is correct.

Here's what the docs say for this statement.

5. IF condition
ifcond ((expr1),(expr2),(expr3)) - evaluates and print result to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE
[<ifcond (([Number1] > [Number2]), ([Number3+10]),([Number3]))>],
Number1 = 125
Number2 = 100
Number3 = 50
Result: 60

NOTE: you can use this function for more sophisticated conditions. For example: if value payment = cc then _browser_out = credit-card-processing.html if not then another condition etc.

I contacted there customer service by email and it took three days and I got this response:

Ticket Subject : IfCond Problems in FormProcessorPro

We would like to inform you that you should use "==" instead "="

Here is an example:
<ifcond (([value High_Gloss] == [Ordered]), ([value High_Gloss_Price] =
[0.99]),([value High_Gloss_Price] = [0.00]))>

I tried that and it didn't work either. It doesn't seem to recongnize the syntax. I have emailed them again but yet still no result so I turn to you in this first post on the forum so I'm trying to be very informative with all the info I have.

The script that handles the form is in php and I will post the part that handles the ifcond here:

function ifcond ($cond, $res1, $res2)
if ($cond) {
return sprintf("%s", $res1);
} else {
return sprintf("%s", $res2);


That's all I have folks please help me to figure out this ifcond statement.

09-01-2006, 08:41 AM
it's not really anything to do with PHP, so this is pure guessing, but their example uses 'value' before the assignments and []s around both sides, yours doesn't....?

[_send_email1 = emailin-unsubscribe.txt]


[value High_Gloss_Price] = [0.99]

09-01-2006, 01:53 PM
Tried it with the "value" in place...like stated above but still nothing. Even tried it with the brackets. Still nothing. I actually copied there example (cut&paste) and just changed the field names and still nothing.

Since the script is php that is parsing the html form it should be in the way php reads it (am I not correct?)

I zipped the entire php script formprocessor.php to a zip file so maybe some one can look at the entire code and tell me what's going on.


Thanks in advance,

B Watford