FlexCode SDK

Sample Code For PHP


Thank you for purchasing our product. If you have any questions that are beyond the scope of this help file, please feel free to contact us.

Most of the questions are already answered in the FAQ's:
https://www.apachefriends.org

Linux installation refer to this following FAQs https://www.apachefriends.org/faq_linux.html

Windows installation refer to this following FAQs https://www.apachefriends.org/faq_windows.html

OS X installation refer to this following FAQs https://www.apachefriends.org/faq_osx.html

/demo_flexcodesdk
    (Sample Pages...)
    /assets
        /css
        /font
        /image
        /js
    /database
    	demo_flexcodesdk.sql (Sql file import to your database server)
    /include
    	function.php (Customize PHP function for this sample)
    	global.php (Customize global setting for this sample)
    	head.php
	        

 

After you download sample code from our website http://www.flexcodesdk.com/ extract the file into your web server and you can see the files looks like files structure in the page before.

  1. Open global.php inside folder /include/global.php

    $base_path customize this line with your sample code url.
    $db_name customize this line with your database name.
    $db_user customize this line with your database user.
    $db_pass customize this line with your database user password.
    $time_limit_reg customize this line with number (used for show the register interface for fingerprint).
    $time_limit_ver customize this line with number (used for show the login interface for fingerprint).

You can add and delete device in the device menu.

You can add, delete, register fingerprint or login user menu in the User menu.

Step by step fingerprint enrollment process :

  1. Click Register button, it call external protocol FlexCodeSDK.exe and send the url to get enrollment paramaters
  2. FlexCodeSDK.exe will run and request the input parameters on the url (register.php).
  3. Web server respond the request 'echo "$user_id;SecurityKey;".$time_limit_reg.";".$base_path."process_register.php;".$base_path."getac.php";'
    • $user_id is User ID
    • SecurityKey is a strings to encrypt the template, please use the same SecuriKey when verify the template.
    • $time_limit_reg is a numeric in second, how long the FlexCodeSDK.exe will run for enrollment process.
    • $base_path."process_register.php;" is url to send the result of enrollment process.
    • $base_path."getac.php" is url to get activation code, the activation code will store in device.ini file.
  4. User scanned the finger at least 4 times in given time, if not the enrollment process fails.
  5. If the enrollment process is success, FlexCodeSDK.exe send the template to the url $base_path."process_register.php;".
  6. In $base_path."process_register.php;" you can tell FlexCodeSDK.exe to open a new page or not. Please see the image code below

You can login user in the Login menu. When the verication success, it will open a new page.

Step by step fingerprint verification process :

  1. Click Login button, it call external protocol FlexCodeSDK.exe and send the url to get verification paramaters
  2. FlexCodeSDK.exe will run and request the input parameters on the url (verification.php).
  3. Web server respond the request 'echo "$user_id;".$finger[0]['finger_data'].";SecurityKey;".$time_limit_ver.";".$base_path."process_verification.php;".$base_path."getac.php".";extraParams";'
    • $user_id is User ID. FlexCodeSDK for web only support 1 to 1 verification.
    • $finger[0]['finger_data'] is user's fingerprint template.
    • SecurityKey is a strings to decrypt the template, please use the same SecuriKey when enroll the template.
    • $time_limit_reg is a numeric in second, how long the FlexCodeSDK.exe will run for verification process.
    • $base_path."process_verification.php;" is url to send the result of verification process.
    • $base_path."getac.php" is url to get activation code, the activation code will store in device.ini file.
    • extraParams is to give a Transaction ID, this ID is used to determine the verification is done for which transaction.
  4. User scanned the finger in given time, if not the verification process fails.
  5. If the verification process is success, FlexCodeSDK.exe send the template to the url $base_path."process_verification.php;".
  6. In $base_path."process_verification.php;" you can tell FlexCodeSDK.exe to open a new page or not. Please see the image code below

You can view the log information of login user in this Log menu.