Good morning!
I'm trying to create a "serial" verification system with php. It would work more or less like this. On an X server it will store the views of server Y; On server Y I would just have a html template where these views would be displayed.
But for this X Server needs to compare a key, like a verification serial, as in some desktop programs that when you buy it receives a registry key. This key would be stored on server Y and would be fixed, Server X will store in its own database, txt or wherever possible. several of these keys.
I apologize if I was not clear, but I have been since 6 am yesterday trying and so far I have not achieved anything viable. One detail, the server Y can not know how to store this information, it only needs to confirm if the keys hit and receive the views of 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');
?>