• Hi, love the code and it has worked on 4 other of my sites.. but I put a piece of code to just determine a user name on a membership page on a site with a SSL cert on it and It doesn’t seem to work.. is there anything special that a Https site causes versus a Http..

    here is the code I use.. pretty basic..

    [insert_php]
    global $current_user;
    get_currentuserinfo();

    $uname = $current_user->user_login;

    echo ‘Username: ‘ .$current_user->user_login. “<br>”;
    echo ‘User email: ‘. $current_user->user_email . “<br>”;
    echo ‘User first name: ‘.$current_user->user_firstname. ” ” .$current_user->user_lastname. “<br>”;
    echo ‘User display name: ‘.$current_user->display_name. “<br>”;
    echo ‘Session Authority: ‘.$_SESSION[‘auth’]. “<br>”;
    echo “<br>”;
    echo “<br>”;
    if($uname == “”)
    {
    echo ” <h2> You are not logged in ! </h2> <br>”;
    echo ” <h2> Please Log in by going to the ‘Home’ page and using the ‘Log In’ module..</h2> <br>”;
    echo ” <br>”;
    exit();
    }
    echo ” =============== PAGE SELECTOR ============================== “;

    [/insert_php]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WillBontrager

    (@willbontrager)

    Insert PHP should work on both secure and non-secure sites equally well – generally even if the PHP code used with Insert PHP is asked to access an HTTPS URL. The plugin otherwise makes no calls to HTTP or HTTPS.

    The issue may be related to $current_user. Insert PHP can’t access variables declared outside the current code block. See
    https://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitself

    Your error logs may also contain a clue.

    Will

    Thread Starter tbehrservices

    (@tbehrservices)

    I will check the coding again.. I have 4 sites running this exact stuff, well I assume I cut and pasted correctly and that works.. so.. the only difference that I can see right off the top is the use of a SSL CERT for the site.. this one is and the others are not.

    thx much..
    Terry

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insert PHP and Secured sites.’ is closed to new replies.