Display members data on members only pages
You can display information stored in members profiles on protected pages of your website. It will be visible to logged in members only.
You can collect this information using registration / edit profile forms and maintain it on Members Edit page of your AuthPro account manager.
Add AuthPro page protection code to load member's data
By default AuthPro protection code loads only basic member's data: login and email address. If you want to load all data stored in members profile, you need to add 'get_profile=1' option to protection script URL:
<script src="https://www.authpro.com/cgi-bin/auth.fcgi?user=YOUR_ACCOUNT&action=pp&get_profile=1">
</script>
(make sure to replace
YOUR_ACCOUNT with your actual AuthPro account username)
Display member's data
You can display member's data using JavaScript variables loaded in previous step. Variable name is same as profile name, saved from registration or edit profile field name.
Please note, Javascript variables are case-sensitive.
You can check for correct variable names by opening protection script source in your browser:
Examples
Here is default 'welcome message' you can dispaly to your members:
<span id="ap_welcome"></span>
<script>
document.getElementById("ap_welcome").innerHTML = "Welcome, "+login;
<script>
Here we modify it to display member's name, country and account expiration details (if set):
<span id="ap_welcome"></span>
<script>
if (typeof(name)=='undefined') { name=login; }
if (typeof(country)=='undefined') { country=''; }
var ap_welcome="Welcome, " + name;
if (country!='') { ap_welcome+= " from " + country; }
if (exp_days!='') { ap_welcome+=" (your account will be expired in " + exp_days + " days)"; }
document.getElementById("ap_welcome").innerHTML = ap_welcome;
<script>
Here is sample code to display logged in member's avatar from
Gravatar database:
<script>
document.write(gravatar_img(email,'','140'));
</script>
You can use second param of gravatar_img function to show your own default avatar image URL and third param to specify image size in pixels.