Mensa India Database Database
Home
Services
Auth Service
Naming Service
Reminder Service

Keys

Naming Service


Remote User Naming Service

The Remote User Naming Service is to allow Mensa Websites to personalize their content. Websites that use the Auth Service can get member names using this service and provide a more personal interface to the users.

The naming service is invoked by calling one of the naming files : http://indianmensa.org/db/services/naming/naming.php or http://indianmensa.org/db/services/naming/namingXML.php.
The membership no is passed as GET parameter. To specify the Membership No use the "MemNo" parameter.

Example

To find the name of a user with the Membership No (The Membership No, uniquely identifying each user) 11000012, you will make a call as follows :
http://indianmensa.org/db/services/naming/naming.php?MemNo=11000012

The resulting page is a plain text file with 3 lines. The first line is the firstname, the second line the middle name and the third line the last name. If the member does not exist, it does not give any error but the 3 lines are blank.

The file http://indianmensa.org/db/services/naming/namingXML.php returns the same output but parses it as XML.



How to use these files to get a Member's name.

Getting Member's names with the help of these files is simple. You can write a funtion that calls this page and read its output.

Code Example

Say you are using PHP, your function would be as follows.

<?php
function getName($mem)
{
$fp=fopen("http://indianmensa.org/db/services/naming/naming.php?MemNo=$mem);
$name="";
while (!feof($fp)){$name =. fgets($fp,100);}
return $name;
}
?>

This was merely an example using the plain text file. If you wish to you can use the XML file namingXML.php. The GET parameters remain the same only the output format differs. The XML file can be used with PHP's XML functions or for that matter with any other language that supports reading XML. The main reason for including the XML file was to support future projects that may incorporate AJAX.


Example AJAX Implementation (using namingXML.php)
Membership No :


Valid XHTML Valid CSS PHP
Copyright (c) 2008 Indian Mensa
The Mensa logo is a registered trademark of Mensa International Limited, all rights reserved.
Mensa does not hold any opinion, or have or express any political or religious views.