WP/AJAX question – How do I access a user’s ID info from outside WP?
-
Here’s the scenario:
I’m using WP 2.5.1 and the SACK AJAX library to enable AJAX functions on a particular page on my site. Right now the file being called by the client side is not a file that is part of WordPress. Since the file on the server is not part of WP, I don’t have a way to access any WP informationI would like the server side file to have access to the user’s account information.
As far as I can tell, there a few ways to do this:
1) Integrate my server side file (the one responding to the client’s AJAX request) part of WP. I don’t know how to do this, but it might be ideal.2) Figure out a way to give the existing server side file access to the WP users’ information. I could access the WP database easily enough, but I’d have no way of knowing which user is accessing the file.
3) Use WP to put client ID information INTO the page which will be making the AJAX call and pass that client ID information back to the non-WP server side file which would allow it get info on the user. This is a clumsy and inelegent way of doing things.
I would appreciate any insight into how you might solve this problem.
Thank you,
– H
- The topic ‘WP/AJAX question – How do I access a user’s ID info from outside WP?’ is closed to new replies.