The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] help with php code inserted in header.php file (2 posts)

  1. tkm
    Posted 7 years ago #


    I've inserted the below php if statement code into the header.php file. The code checks to see if a user is logged in or not and then shows some text accordingly. For some reason the if part is not being recognised and else text is always being shown. I have this same php code in the index.php template file and it works fine. So, it seems to be just an issue with the header.php file. Any help would be much appreciated!

    if(isset($HTTP_SESSION_VARS['user_ids']) && $HTTP_SESSION_VARS['user_ids'] != "")
      $user_ids = $HTTP_SESSION_VARS['user_ids'];
      $Query_user_log = mysql_query("select * from  wp_users where ID = '$user_ids'");
      $num_log = mysql_num_rows($Query_user_log);
      if($num_log > 0)
      $result_log= mysql_fetch_array($Query_user_log);
      $user_name = $result_log['user_nicename'];
      echo "<<em>output this text</em>> ";
      echo "<<em>output this text instead</em>>";
  2. tkm
    Posted 7 years ago #

    Hi guys,

    I ended up findng a resolution after much searching online. Here is the resolution:


Topic Closed

This topic has been closed to new replies.

About this Topic