Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter iso96

    (@iso96)

    i ve cracked it, thank god for that.

    I use an IDE called Webdev and was using a the command PHPExecute, i tried ScriptDisplay and it worked.

    Thank you for all your help on this its very much appreciated.

    iso

    Thread Starter iso96

    (@iso96)

    hello kept it as simple as possible and it still just returns 0 even though i am logged in?

    <?php
    define(‘WP_USE_THEMES’, true);
    require(‘C:/Inetpub/vhosts/site.co.uk/test.site.co.uk/Forum/wp-includes/user.php’);
    ?>
    <?php $user_ID = get_current_user_id();
    echo $user_ID;
    ?>

    This is the process

    open wordpress site and login
    open external site which runs the script above
    returns 0

    am i missing something?

    thanks

    iso

    Thread Starter iso96

    (@iso96)

    Hi,

    I can get their example code to work (the blog) but still cant get it to show the user ID!

    iso

    Thread Starter iso96

    (@iso96)

    Hi i have put uploaded the external site to the same server and its seems to be getting closer:

    <?php
    require_once(‘C:/Inetpub/vhosts/site.co.uk/test.site.co.uk/wp-includes/user.php’);

    $user_id = get_current_user_id();
    if ($user_id == 0) {
    echo ‘You are currently not logged in.’;
    } else {
    echo ‘You are logged in as user ‘.$user_id;
    }
    ?>

    the only problem is its ssays im not logged in when i am! at least its not showing an error message.

    any more ideas?

    Thread Starter iso96

    (@iso96)

    Hi

    Thanks for helping me with this, i did that the quote missing but when i added it, it was still the same.

    tried this:

    <?php
    require_once(ABSPATH. ‘wp-includes/pluggable.php’);
    $current_user = wp_get_current_user();
    echo ‘User ID: ‘ . $current_user->ID . ‘
    ‘;
    ?>

    but also still not working.

    This is what i am try to do:

    I have an external site that shares the wordpress database.
    I want when someone logs into wordpress site they can do all the stuff on the wordpress site forum/blog etc. but i also have a menu with links to pages of my external site.
    So when the user clicks on a link to open a page eg ‘external site scheduler’ the page opens and recognises the userid whos logged into wordpress and then looks up that userid in my tables and shows that users ‘schedule’

    hope that makes sense.

    iso

Viewing 5 replies - 1 through 5 (of 5 total)