WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] return current user ID in a link? (3 posts)

  1. cartpauj
    Member
    Posted 6 years ago #

    I have a small blog with only a limited number of users. I would like to create a page for all my users to display their information for them. I would like to name the page the same as there ID so for example if bob's user ID was 5 I would like to have a link on my pages bar that would use some php to take him to the correct page based on his user ID. I tried the following but it didn't work:
    <?php $myID = $userdata[0][0]; ?>
    <?php echo "<li><a href='http://localhost/heidifitness/?page_id="+ myID +"'>Click</a></li>"; ?>

    Any help would be much appreciated!

  2. cartpauj
    Member
    Posted 5 years ago #

    anyone?

  3. cartpauj
    Member
    Posted 5 years ago #

    Nevermind I got it!

    <?php global $user_ID;
    get_currentuserinfo();

    echo "

  4. Click
  5. ";
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags