WordPress.org

Ready to get started?Download WordPress

Forums

Username in blankpage (4 posts)

  1. iwann
    Member
    Posted 6 years ago #

    hello everybody
    i want to make a small php game for wordpress. and i want to
    be able to take over the session/cookie :s or whatever of wordpress and make the username apear on a blank page.
    so whenever ppl win at my slot machiene , they can get "money". the script for the slots i got to work. but now i just need to query it to the right user and i think i need to use sessions or something.to get the right username for the WHERE part of the quere. could somebody help me ? i'm new to plugin making.

    thanks a lot!

  2. Adam Brown
    Member
    Posted 6 years ago #

  3. iwann
    Member
    Posted 6 years ago #

    don't i need to connect to the databse or something ? or take over a sesssion , cause when i just put

    <?php global $userdata;
          get_currentuserinfo();
    
          echo('Username: ' . $userdata->user_login . "\n");
          echo('User level: ' . $userdata->user_level . "\n");
          echo('User ID: ' . $userdata->ID . "\n");
    ?>

    in a file it doesn't do anything. so i need a session / db connection?

    i am reading about cookies , how do i get the username out of the cookie :) $_COOKIE[???

  4. iwann
    Member
    Posted 6 years ago #

    got it to work , needed the blog header :) tnx

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags