I also have a lic.txt at domain.com which contains the string "1234567".
When I run this script it output this error:
Warning: fread(): Length parameter must be greater than 0. in /home/user/public_html/lic.php on line 5
Invalid license key
But if I put lic.txt next to this script and use this instead:
$fp = fopen("lic.txt", "r");
then it works perfectly..
As you probably understand Im going to use this as a very very simple lilcense system and I cant have the correct 'serial' next to it, but rather have it somewhere else or on other server as the user who uses this must not be able to view the correct key.. (yes I will encode) so the lic.txt needs to be on another serv.. but that doesnt seem to work
no, i don't think it is easy. in fact, i was about to use similar method for some scripts of mine. To bypass your license check, they have to crack Ioncube which is impossible up until now.
however, the important thing is that if your sever ever goes down, your clients can not use your script -they would come after you so, to be safe...check if the file exists or can be read, if not....let the script be executed as usual without your customer knowing it
But still.. I cant have the .txt containing the license next to the script :\
Like I add it to some product which I send to some guy, I want to be able to shut he's script down at any time by changing the content of lic.txt, so that definetly needs to reside at my server, not next to his script :\
I thought fopen(); could be used for opening remote files =|
If this is not working.. could I use any similar methods? fsockopen or something like that to make it work?
But ill take that after hopefully solving this first problem hehe.. step by step.. (im very newb with PHP :\ )
So needs this thing solved first.. most importand thing in a license system would be that the user couldnt manipulate it as they'd want :\
I could possibly do that part by umm.. if server doesnt respond to ping.. then allow code as normal and act as it had valid license.. only when the server goes down tho.. as it will most likely not be down that much for ppl to take advantage of the script that much =| just an idea..