ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder

How Obtain license information (a dynamic fields tutorial)

Author Message
fdumont



Joined: 31 Mar 2006
Posts: 4
Location: Lille

PostPosted: Fri Mar 31, 2006 9:43 am    Post subject: How Obtain license information (a dynamic fields tutorial) Reply with quote

Hello

I wanted to know of obtain a value insert inside the license Key.

Exemple

I create the field Customer inside the key

and i want inside my php application obtain the value


Thank's for you help
_________________
Best reguards

Franck
Back to top
View user's profile Send private message Visit poster's website
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Fri Mar 31, 2006 11:59 am    Post subject: Reply with quote

You can do this using the license properties feature and the Loader API. Enter the name of the property, e.g. CUSTOMER, and the value.

You have the special edition GUI, so you can enter a ? for the default value, and this will create a new page on the main GUI that prompts for the value. This is MUCH nicer than having to edit the license properties page each time to change frequently changing values Smile

I've some screenshots below that show you, and also show the autoencoder interface. I've also used the special syntax of ?="prompt" to change the prompt from the default. The default would be the key itself, which in my example is CUSTOMER, but "Nom de client" looks better.

This is the license properties page. I didn't enter a path for the license file, but you must do that:



This is how the main GUI changes now that we've created a dynamic field.



If you right click on your saved project file (the .iep file) in Explorer, there is a menu option "Encode Project". If you choose that, you get the smaller autoencoder interface, again with your custom field. Note that your project also gets encoded, and if you don't want that, just create a project file that has no source files, and that is just used for licensing purposes.



To read values, use ioncube_license_properties(). This returns the license file properties for the license file that is being used by the encoded file that calls the API function.
_________________
Community Admin
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Fri Mar 31, 2006 12:43 pm    Post subject: Reply with quote

After generating a license file for "Milton Pugwash" as the customer name using the above project settings, I encoded a file with the following in it:

Code:
<?php

var_dump(ioncube_license_properties());

?>


This is encoded to require a license file, and of course, has the same passphrase as was used to generate the license file. the Loader located the license file that I created, and the output is then as follows:

Code:
$ php read_lic.php
array(1) {
  ["CUSTOMER"]=>
  array(2) {
    ["value"]=>
    string(14) "Milton Pugwash"
    ["enforced"]=>
    bool(false)
  }
}


So you can see how to read back the value for the property called CUSTOMER that we setup in the project.

Hope this helps!
_________________
Community Admin
Back to top
View user's profile Send private message
fdumont



Joined: 31 Mar 2006
Posts: 4
Location: Lille

PostPosted: Fri Mar 31, 2006 4:54 pm    Post subject: Reply with quote

Thank's

I have try and is ok..


Very Good
_________________
Best reguards

Franck
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum