mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 14:13:27 +02:00
Version 0.95 BETA
This commit is contained in:
28
api/newlogin.php
Normal file
28
api/newlogin.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
function generateRandomString($length = 6) {
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyz';
|
||||
$charactersLength = strlen($characters);
|
||||
$randomString = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$randomString .= $characters[rand(0, $charactersLength - 1)];
|
||||
}
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
$code = generateRandomString();
|
||||
|
||||
|
||||
require_once("phpqrcode.php");
|
||||
ob_start();
|
||||
QRCode::png($code, null, QR_ECLEVEL_H, 7, 1);
|
||||
$qrcode = base64_encode( ob_get_contents() );
|
||||
ob_end_clean();
|
||||
|
||||
$data = array(
|
||||
"qrcode" => $qrcode,
|
||||
"code" => $code,
|
||||
"status" => "waiting"
|
||||
);
|
||||
|
||||
echo json_encode($data);
|
||||
?>
|
Reference in New Issue
Block a user