Support » Fixing WordPress » Creating a session variable from user ID – problem?

  • ruraldev

    (@ruraldev)


    I am trying to create a session variable for use in an iframe page.

    I thought this would work but I was wrong, can anyone help please?

    The following code is in a non wordpress page.

    <?php
    session_start();
    include '../wp-config.php';
    ?>
    <?php
    $_SESSION['UserID'];
    get_currentuserinfo();
    echo $_SESSION['UserID']->ID;
    ?>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" height="500">
      <tr>
        <td valign="top">
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" height="20">
      <tr bgcolor="#D0C1F7" >
        <td width="13%"></td>
        <td width="78%" class="sitename">Cycling routes supplied by </td>
        <td width="9%" align="right" valign="bottom">
    	<?php if($_SESSION['UserID']!=NULL){?>
    	<a href="home.php">Home</a>|&nbsp;|<a href="logout.php">Logout</a>
    	<?php } ?></td>
      </tr>
    </table>
    <?php echo $_SESSION['UserID'];?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating a session variable from user ID – problem?’ is closed to new replies.