Hi,

I've got some PHP in an INLINE frame. I want to use in that PHP code the details of the current Drupal user. I've been playing around with it for a while now, and can't get the hang of it.

I've been playing with Drupal_bootstrap, and with
global $user;
echo $user->uid;
echo $user->name;

but don't seem to be getting anywhere!

I'd be very grateful for assistance. Thanks.

Comments

vm’s picture

define "playing with drupal bootstrap" ? what code are you "playing with" ?

use drupalbin.com and link to the code here.

xipheas’s picture

Playing was a colloquialism, sorry. I meant 'trying to understand how it all works'. I haven't altered anything I shouldn't have, don't worry!

http://drupalbin.com/15164?nocache=1

Then if I use
global $user
print_r($user);
in the same PHP, it hasn't picked up the currently signed in Drupal user, instead telling me that I have an anonymous user.

Very confused, slightly out of my depth, but would love to make it work!

xipheas’s picture

Can anyone help?

vm’s picture

I can't with any specifics but know that when I researched your orginal question there were quite a few requests/threads/conversations that I found with google which may aid you.