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] return current user ID in a link? (3 posts)

  1. cartpauj
    Posted 8 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
    Posted 8 years ago #


  3. cartpauj
    Posted 8 years ago #

    Nevermind I got it!

    <?php global $user_ID;

    echo "

  4. Click
  5. ";

Topic Closed

This topic has been closed to new replies.

About this Topic