2
18

Check a signmii

Checking a signmii by program decodes its content and returns it.

Download the code of the sendget function defined in the file sendhttp.php. Copy the file in the space of your application.

NOTE: See the page Call the service API for a description of the sendget function.

URL
https://signmii.com/api/checksignmii?login=&password=&signmii=
loginYour identification code.
passwordYour password.
signmiiThe text of the signmii to decode.

signmii is the string of characters returned by the getsignmii action.

Add the file checksignmii.php with the following content:

  1. require_once 'sendhttp.php';

Loads the code of the sendget function provided by iZend.

  1. function checksignmii($login, $password, $signmii) {

Defines the function checksignmii. $login is your identification code. $password is your password. $signmii is the string of characters built by the encoding of a signmii.

  1.     $curl = 'https://signmii.com/api/checksignmii';
  2.     $args = array(
  3.         'login'     => $login,
  4.         'password'  => $password,
  5.         'signmii'   => $signmii,
  6.     );

Sets $curl to the URL of the checksignmii action. Fills the array $args with the parameters of the checksignmii action. NOTE: Replace http by https in the URL to encrypt the communication.

  1.     $response=sendget($curl, $args);

Sends the HTTP request with sendget.

  1.     if (!$response or $response[0] != 200) {
  2.         return false;
  3.     }

If $response is false, the server is unreachable. If $response[0] doesn't contain the HTTP return code 200 Ok, an execution error has occurred. In case of error, checksignmii returns false.

  1.     return $response[2];
  2. }

Returns the body of the response, i.e. the SHA1 contained by the signmii, the date and the time of creation of the signmii and its serial number.

EXAMPLE

Assuming you have saved the files sendhttp.php and checksignmii.php in the current directory, run PHP in interactive mode, load the checksignmii function and call it with your identification code, your password and a signmii in argument:

$ php -a
php > $signmii='uIWPRlfPaB8VgkTHIg8IoTe72WtTLgL_vGoWjY8PfM9fFjwXb8LmvMsMGKVUUTvJOy-z536BC-GMCOaDDdHhcWqGEYyUlXULwwGBXQL7drGnnbTa0H4bCD1YME6H9q7xIdMqlD9pIS-CIAsAo1SYguOhHP9bBlZ_7vk91gmKmxJQi6ril_UlvUmvmjJbUSnoyvDBLPcOWTa0hPDiPKnLifaimHHzkKfLtD9Ck2DAam9G3q3ME0zayVOTTlFdyPsOwvM6SvOMqAi-iBV40Bg5Ky4wKJztDMiCCBCdx3k-jvMfVtZM61MoIDNaICeI59UYE-HL8cPX3CcRphXYdFmRHg';
php > require_once 'checksignmii.php';
php > echo checksignmii('abcdef', 'ABCDEF', $signmii);
ed0847ae3231350b0153cd8b9c8f56b87ab37801 2014-05-19T21:36:11Z 0000000000000001
php > echo sha1('signmii');
ed0847ae3231350b0153cd8b9c8f56b87ab37801
php > quit
SEE ALSO

Get a signmii

Comments

Your comment:
[p] [b] [i] [u] [s] [quote] [pre] [br] [code] [url] [email] strip help 2000

Enter a maximum of 2000 characters.
Improve the presentation of your text with the following formatting tags:
[p]paragraph[/p], [b]bold[/b], [i]italics[/i], [u]underline[/u], [s]strike[/s], [quote]citation[/quote], [pre]as is[/pre], [br]line break,
[url]http://www.izend.org[/url], [url=http://www.izend.org]site[/url], [email]izend@izend.org[/email], [email=izend@izend.org]izend[/email],
[code]commande[/code], [code=langage]code source en c, java, php, html, javascript, xml, css, sql, bash, dos, make, etc.[/code].