Title: Insert PHP and Secured sites.
Last modified: February 8, 2017

---

# Insert PHP and Secured sites.

 *  [tbehrservices](https://wordpress.org/support/users/tbehrservices/)
 * (@tbehrservices)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-php-and-secured-sites/)
 * 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)

 *  [WillBontrager](https://wordpress.org/support/users/willbontrager/)
 * (@willbontrager)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-php-and-secured-sites/#post-8785956)
 * 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
    [http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitself](http://www.willmaster.com/software/WPplugins/insert-php-wordpress-plugin-instructions.php#inandofitself)
 * Your error logs may also contain a clue.
 * Will
 *  Thread Starter [tbehrservices](https://wordpress.org/support/users/tbehrservices/)
 * (@tbehrservices)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/insert-php-and-secured-sites/#post-8786046)
 * 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.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3475630)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [tbehrservices](https://wordpress.org/support/users/tbehrservices/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/insert-php-and-secured-sites/#post-8786046)
 * Status: not resolved