1
Good morning!
I’m trying to create a "serial" verification system with php. It would work something like this. On an X server it will store the views of the Y server; On the Y server I would only have an html template where these views would be displayed.
But for this the X Server needs to compare a key, as if it were a serial check, as well as in some desktop programs that when you buy it gets a registration key. This key would be stored on the Y server and would be fixed, the X Server will store in its own database, txt or wherever possible. several of these keys.
I apologize if I wasn’t clear, but I’ve been trying since 6:00 yesterday morning and so far I haven’t achieved anything viable. One detail, the Y server cannot know how this information is stored, it just needs to confirm that the keys match and receive the views from the X server.
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Teste</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/form.css">
<script src="js/main.js"></script>
</head>
<body>
<img id="logo-top" src="img/logo.png" alt="">
<div id="wrapper">
<?php
include_once 'http://servidor.com.br/end/ctl/Version.class.php';
?>
</div>
<footer>
</footer>
</body>
</html>
<?php
class Version {
private $client;
private $server = array("!01@1-1#20-15$0-3%14",
"!01@1-1#20-15$0-3%15");
public function checarVersao($link){
$ponteiro = fopen($link, "r");
while(!feof($ponteiro)) {
$linha = fgets($ponteiro, 4096);
$this->client = $linha;
if(in_array($linha, $this->server)) {
switch($linha) {
case "!01@1-1#20-15$0-3%14":
include_once '../viw/index.php';
break;
case "!01@1-1#20-15$0-3%15":
include_once '../viw/erro404.php';
break;
}
} else {
echo '<script>alert("Erro no serial");</script>';
echo '<div id="serial-incorreto">serial incorreto! verifique o serial fornecido e tente novamente.</div>';
}
}
fclose($ponteiro);
}
}
$version = new Version();
$version->checarVersao('servidor.com.br/end/serial.txt');
?>
This is looking more like javascript than PHP, huh! Be careful with this operation
– Wallace Maxters
The problem is the visibility of the code between the two servers. I could not define exactly what this fits, one because php does not compile the files and is server-side, I’ve been reading about web services but I didn’t understand it very well, and it seems useless for this case.
– Rech
Apparently what you want is to prevent copying or misuse of your code. If it is really that, I already say that it is useless to try these things in PHP. Any programmer with just a little bit of experience breaks this barrier without difficulty.
– Marcos Regis