Nov 10th, 2010, 5:41 AM
(Nov 9th, 2010, 9:08 PM)Ben Wrote: Hi Printline,
Sorry! There's always a million things to do around here!
Cool, so since the user just logged in, information about their account is in sessions.
1. On your form page, make sure that sessions have been started. (session_start()).
2. As a test, add this line to your form somewhere:
PHP Code:Client ID: <?php echo $_SESSION["ft"]["account"]["account_id"]; ?>
If everything is working, it should output the client ID. If it does, just delete it.
3. Next, we're going to use that ID to get all the client info:
PHP Code:<?php
$account_info = ft_get_account_info($_SESSION["ft"]["account"]["account_id"]);
print_r($account_info);
?>
You can then use that information to populate your form.
Any help at all?
- Ben
Hi' Ben
Thanks for the response. It actually works great! One thing though, that troubles me a bit is this:
I got it working by doing the following:
I set the php code like this:
PHP Code:
$account_info = ft_get_account_info($_SESSION["ft"]["account"]["account_id"]);
$emailaddresse = ($account_info['email']);
$name =($account_info['first_name']);
And then display the information in the form in a textbox like this:
<input type="text" name="firstname" value="<?php echo $emailaddress; ?>" />
<input type="text" name="email" value="<?php echo $name; ?>" />
The issue is now, that i want to retrieve some informaton from additional fields from the account, which i have made by using the Extended Client Fields module.
As far as i can see these data are being placed in another location. When i do the print_r function i get this:
Code:
Array ( [account_id] => 2 [account_type] => client etc...
Code:
Array ( [account_id] => 2 [account_type] => client etc..[settings] => Array ( [client_notes] => [company_name] => Printline [ecf_1] => 12345678 [ecf_2] => Nordbirkvej 4 etc...
Can you tell me how i can retrieve and show these information also....???
Thanks a lot!
Printline