Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problems with ifcond in Form Processor Pro

    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:

    Code:
    <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>
    </select>
    <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">
    </form>
    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.

    Code:
    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
    Example:
    [<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:

    Code:
    Ticket Subject : IfCond Problems in FormProcessorPro
     
    Reply:
    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:

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

    }
    //ifcond 

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

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    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....?
    i.e.
    PHP Code:
    [_send_email1 emailin-unsubscribe.txt
    vs
    PHP Code:
    [value High_Gloss_Price] = [0.99

  • #3
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    formprocessorpro.zip

    Thanks in advance,

    B Watford


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •