Display members data on members only pages


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>
  // first check if profile variables exists to avoid any errors:
  if (typeof(name)=='undefined') { name=login; }
  if (typeof(country)=='undefined') { country=''; }
  // prepare and display message:
  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.

Please contact us if you have any questions.