get_current_user_id()
-
Hello,
I m new to php and am trying to get the current users ID from an external site as i want to use this ID in another table/site i have created, this is what i have done.
i created a page called WP_USER_LOG.php
and with this code:
<?php require_once(www.mysite.co.uk/wp-includes/pluggable.php'); $current_user = wp_get_current_user(); echo 'User ID: ' . $current_user->ID . ''; ?>
then when i try and run the script from this page externally i would expect to get the id but i get the following:
Server Error
500 – Internal server error
There is a problem with the resource you are looking for, and it cannot be displayed.hope someone can help me with this im getting desperate now
many thanks
iso
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘get_current_user_id()’ is closed to new replies.