Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 26

Thread: Help with an If statement

  1. #11
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Help with an If statement

    yep, it looks fine

    so, maybe ur db code is zapping "distr"

    disable the db code and see wot appears in the email

  2. #12
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Help with an If statement

    another test i'd try is setting distr in the derive with a fixed value:
    HTML Code:
    <input type="hidden" name="derive_fields"  value="imgverify=recaptcha_response_field,realname=FirstName + LastName,distr=%'Test Distr'% "/>
    but test the effect of ur db code first

  3. #13
    Join Date
    Mar 2010
    Posts
    40

    Default Re: Help with an If statement

    Sorry, how do I disable db code? I will try the distr as a fixed value

  4. #14
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Help with an If statement

    Quote Originally Posted by pitzerwm View Post
    Sorry, how do I disable db code? I will try the distr as a fixed value
    i dunno.

    db code isn't standard in formmail, so it must be something u added or someone added for u

  5. #15
    Join Date
    Mar 2010
    Posts
    40

    Default Re: Help with an If statement

    Ok, I made distr fixed and this is the email.

    who: 2
    distr_2:
    other_distr: test new company
    distr_head: NY
    So it appears that it is ignoring distr all together. in the insert.php it converts $distr=$_POST['distr'];

  6. #16
    Join Date
    Mar 2010
    Posts
    40

    Default Re: Help with an If statement

    One thought, in the past the text box was "distr" reading your original post, I changed the text box to other_distr and the drop down box to distr_2. Is this possible the issue?

  7. #17
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Help with an If statement

    Quote Originally Posted by pitzerwm View Post
    One thought, in the past the text box was "distr" reading your original post, I changed the text box to other_distr and the drop down box to distr_2. Is this possible the issue?
    no.

    $distr=$_POST['distr'];
    thats OK, but wot else does it do?

    save a backup copy then delete all the lines in insert.php and see if u get "distr" in the email

    just checked ur derive_fields again:
    HTML Code:
     ...,distr=%if(distr_2;distr_2;other_dist)% "/>
    the space before the " and the lack if it after might be an issue

    make it:
    HTML Code:
     ...,distr=%if(distr_2;distr_2;other_dist)%" />

  8. #18
    Join Date
    Mar 2010
    Posts
    40

    Default Re: Help with an If statement

    Thanks again crabtree for your time.

    I illiminated the space, no change. I deleted all of the code in the insert.php, no difference. I used text box.

    I just realized something!!! At the end of the email the "Distr" is listed and correct if you use the drop down box, but empty if you use the text box. For some reason it still isn't making it to the database, but at least we have confirmed that your code works, I'm really sorry that I missed that. I was looking where it normally was.

    Email:
    who: 1
    distr_2: A-OK Equipment Co
    other_distr:
    distr_head: AK
    Product: Turnkey Quicklube Package
    model:
    Quality: 3
    Price: 3
    Timeliness: 3
    Overall: 3
    Comments: test 3:21
    distr: A-OK Equipment Co
    Last edited by pitzerwm; 03-May-2010 at 09:42 PM.

  9. #19
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Help with an If statement

    i'm stumped....

    but, one thing...

    ur email shows a value for distr_2.

    how come it has a value?

    that might be the problem

    u could try this instead:
    HTML Code:
    ...,distr=%if(other_dist;other_dist;distr_2)%
    otherwise, i think u better buy some support from tectite

  10. #20
    Join Date
    Mar 2010
    Posts
    40

    Default Re: Help with an If statement

    Thanks again for your help. I changed the name of the text box back to the original "distr" If I use the text box, it enters it into the database.

    I changed the dirived to this distr=%if(dist;dist;distr_2)%

    When I use the drop down box the email is correct, but it doesn't input it into the database. Seems that we are closer. Thanks again for your time.

    A question, why not place in the insert.php file something like:

    IF (empty 'distr' ) distr = 'distr_2';

    of course, I don't know the correct syntax.

    who: 1
    distr_2: A-OK Equipment Co
    distr: A-OK Equipment Co
    distr_head: AR
    Product: Other
    model: 4:09

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 29-Oct-2008, 12:45 PM
  2. Replies: 0
    Last Post: 20-Feb-2008, 06:52 PM
  3. Replies: 4
    Last Post: 05-Jul-2007, 04:07 AM
  4. Replies: 2
    Last Post: 05-Jul-2007, 02:41 AM

Bookmarks

Posting Permissions

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