I am trying to create a licensing system where you have a license key as a variable in a file. Then, it includes a file that's on an external server. The server then does all the validating, and returns whether the key is valid or not. The problem is, an experienced PHP programmer could just remove the include, and change the variable to true. Does anyone know of a way to force a file to be included? I'd like for all the security stuff to be on my server, not my client's.
Here's some of my code:
serial.php
<?php
$serial = "a1b2c3d4e5g6h7i8j9k0";
include("http://myserver.com/validate/license.php");
if($valid == 1) {
//license is valid
}
else {
//license is not valid
}
?>
http://myserver.com/validate/license.php
<?php
//check with MySQL database to see if license is valid
//if license is valid...
$valid = 1;
//else...
$valid = 0;
?>