Support

Account

Home Forums Add-ons Repeater Field Repeater field elseif help Reply To: Repeater field elseif help

  • Hi John,

    Basiclally i have a php script which is this:

    <?php
     
    // Simple browser and OS detection script.
    // This will not work if User Agent is false.
     
    $agent = $_SERVER['HTTP_USER_AGENT'];
     
    // Detect Device/Operating System
     
    if(preg_match('/Linux/i',$agent)) $os = 'Linux';
      elseif(preg_match('/Mac/i',$agent)) $os = 'Mac';
      elseif(preg_match('/iPhone/i',$agent)) $os = 'iPhone';
      elseif(preg_match('/iPad/i',$agent)) $os = 'iPad';
      elseif(preg_match('/Droid/i',$agent)) $os = 'Droid';
      elseif(preg_match('/Unix/i',$agent)) $os = 'Unix';
      elseif(preg_match('/Windows/i',$agent)) $os = 'Windows';
      else $os = 'Unknown';
    ?>

    so i was going to use a repeater field to and create a sub field called:

    Windows and another called: Linux and another called Macosx so if on a Windows it displays the Windows field. and if on a Linux computer it shows hte Linux Field etc.

    Thanks
    Aaron