Last active
December 14, 2016 19:38
-
-
Save smallfri/0c3861047b7371203e10 to your computer and use it in GitHub Desktop.
Sample PHP Code for Calling License Engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST) AND array_key_exists('license_key', $_POST)!='') | |
{ | |
$url = 'http://www.licenseengine.com/licenses/a/?action=activate_license&item_name=prime-notify&product_id=YOUR_PRODUCT_ID&license='.$_POST["license_key"]; | |
$json = file_get_contents($url); | |
$obj = json_decode($json); | |
//remove this, it is just for demo purposes. | |
var_dump($obj); | |
echo '</br>'; | |
} | |
if(empty($obj) OR $obj->license!='valid') | |
{ | |
?> | |
<div style="padding: 15px; font-size: 14px;"> | |
<div class="alert alert-error" style="margin-top:10px;color:red;"> | |
Your License Key is NOT Valid. | |
</div> | |
<h4>Registration</h4> | |
<!-- if you leave action blank, the form will post to the same page that it is on.-->" | |
<form method="post" action="" enctype="multipart/form-data" id="license_key"> | |
<div class="button-container"> | |
<input id="license_key" name="license_key" type="text" class="input-xlarge" placeholder="Enter Your License Key" value=""/> | |
<input type="submit" value="Save" id="save_button" class="button action"/> | |
<p>Can't find your key? Login to | |
<a href="//www.licenseengine.com/my-keys" target="_blank">License Engine</a> to retrieve your key. | |
</p> | |
</div> | |
</form> | |
<div style="margin-top:10px;margin-left:185px;"> | |
<img src="//www.licenseengine.com/assets2/img/licensingpoweredbyLE.png"></div> | |
</div> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment