Support

Account

Forum Replies Created

  • Nice 🙂 will give that a go but i did it different method.

    <?php if ( $os == Linux ) { ?> <a href="<?php echo $linux; ?>"><?php echo $os ?></a><br /><br /> <?php } ?>
    <?php if ( $os == Windows ) { ?> <a href="<?php echo $windows; ?>"><?php echo $os ?></a><br /><br /> <?php } ?>
    <?php if ( $os == Mac ) { ?>  <a href="<?php echo $macosx; ?>"><?php echo $os ?></a><br /><br /> <?php } ?>

    And it works perfectly at the moment,

    But it has gave me some insite for something else i amy need to do 🙂

    Thanks
    John

  • 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

  • Hi vandelay, do you still use this method? and if so any chance of the exported JSON so can see how you have set it up please

Viewing 3 posts - 1 through 3 (of 3 total)