• Resolved neilmahaseth

    (@neilmahaseth)


    The plugin works if I use the shortcode but when I use this code

    <?php/*
    Template Name: Custom Redirect
    */ 
    
    $userInfo = geoip_detect2_get_info_from_current_ip();
    var_dump(get_object_vars($userInfo));
    if ($userInfo->country->isoCode == 'de')
     echo 'Hallo! Sch?n dass Sie hier sind!';
    endif;

    in my php template file I receive the following output

    country->isoCode == ‘de’) echo ‘Hallo! Sch?n dass Sie hier sind!’; endif;

    Apparently the php tag is getting closed after parsing “->”. Also no output of the variable dump any idea what could be wrong. I am using PHP 7 and nginx server. I suspect that could be the problem but then the shortcode works fine. Any help appreciated thanks

    https://www.ads-software.com/plugins/geoip-detect/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter neilmahaseth

    (@neilmahaseth)

    Solved the problem. It was because of a syntax problem. This

    <?php/*
    Template Name: Custom Redirect
    */

    should have been written as

    <?php
    /*
    Template Name: Custom Redirect
    */

    Strange php didn’t show any errors for that.
    also only writing
    var_dump(userInfo);
    worked
    Thanks for this plugin. Hope this help others, facing similar problem.

    Thread Starter neilmahaseth

    (@neilmahaseth)

    Forgot to mark as resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 7 Support’ is closed to new replies.