WordPress.org

Forums

Auto-Retrieve WordPress Username (2 posts)

  1. amoradi
    Member
    Posted 11 months ago #

    I have a bunch of CSV files uploaded on my server, each pertaining to a specific user on my WordPress account. What I want is to create a page where each individual user can view only their own information. I know there are some plug-ins that load CSV content directly into the page, but unfortunately I haven't found any that allow for each individual user to view their own.

    What I was thinking of doing was naming each CSV file after the username, so that you would have:

    User: Test File: test.csv

    And including a link or command that would load the CSV file based on the logged-in user. For example it would theoretically look something like this (I know this isn't correct, but just as an example):

    loadcsv ('/data/%WPUSER%.csv')

    Where %WPUSER% would be replaced with the correct username. My background is mainly in C++, so I have no clue if there is a way to do this in PHP. I'd appreciate any help or suggestions that I can get.

    - Ali

  2. s_ha_dum
    Member
    Posted 11 months ago #

    I'd start with this: http://www.php.net/manual/en/function.fgetcsv.php

    There are more complicated libraries out there if you need them.

Reply

You must log in to post.

About this Topic