autofill independant form with joomla user data -


i'm using joomla , form independent of joomla located in separate folder on site.

if user logged joomla i'd name , email of form populated user's data.

i'm trying following, it's not working:

 <?php jimport('joomla.user.helper');        $user = jfactory::getuser();        $name = $user->name;        $email = $user->email;        ?> 

and in value of field:

<?php return $email ?> 

any appreciated!

copy contents of "index.php" file located under root directory of joomla website, remove last line one:

$app->execute(); 

now paste above in php file displaying form.

now next step know user logged in joomla website, won't straightforward since not in joomla environment. can pass joomla session id other website in link , store session id (of joomla website) in session variable on website. can retrieve user id of joomla website based on stored session id.

not easy it'll work.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -