I want to create a system with a license with my own code, but it gives me an error
the code is similar to this, but in lic.txt the same is 1234567, what’s wrong?
This is an error if I put @ before fread dosent to show an error, but does not open the file
Warning: fread (): the length parameter must be greater than 0 in / home / u 422978792 / public_html / platforma / license / index.php on line 7 Invalid license key
<?php
$fp = fopen("http://platforma.dar-project.org/license/lic.txt", "r");
stream_set_timeout($fp, 10);
$license = fread($fp, filesize($filename));
fclose($fp);
if ($license == "1234567") {
echo "Your license key is valid";
} else {
die("Invalid license key");
}
?>
source
share