• Resolved RPL

    (@rpl)


    I want to be able to display a different message depending on whether a user is logged in / not logged in.

    I think the code I need to run is as follows:

    <?php if ( zmember_valid_subscription() ) { ?>
    <!– if user is logged in –>
    <p>You are logged in</p>
    <?php } else { ?>
    <!– if user is not logged in –>
    <p>You are logged out</p>

    When I insert this code, even with the “allow PHP” checkbox ticked, it gives an error:

    Parse error: syntax error, unexpected end of file in /home/iar2017/public_html/wp-content/plugins/advanced-ads/classes/ad_type_plain.php(106) : eval()’d code on line 6

    Can anyone advise what modifications I need to make to the code to get it to run?

    Many thanks 🙂

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

    (@rpl)

    Hi, ignore this, I’ve solved it. I didn’t realise you had to insert the opening and closing php tags!

    <?php
    if ( zmember_valid_subscription() ) {
    echo ‘<p>Logged In</p>’ ;
    } else {
    echo ‘<p>Logged out</p>’ ;
    } ?>

    Plugin Author Thomas Maier

    (@webzunft)

    Hi RPL,

    thanks for also sharing the solution!

    Thomas

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using PHP code’ is closed to new replies.