Support

Account

Home Forums General Issues Conditional PHP renders old values true

Unread

Conditional PHP renders old values true

  • I have a text field which includes a URL.

    $url = get_field('global_contrib_url', 'options');

    I have parsed the URL to identify the host.

    $contrib_url = parse_url($url);
    $contrib_domain = $contrib_url['scheme'] . "://" . $contrib_url['host'];

    Then I set up conditional statements to compare that domain to the value in the field:

    if($contrib_domain == 'https://secure.example1.com'):
    elseif($contrib_domain == 'https://secure.example2.com'):
    elseif($contrib_domain == 'https://donate.example3.com'):
    endif;

    However, unique code I have for source in example3.com conditional statement shows up as the source for either example1.com or example2.com and I cannot figure out why.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.