$value) { if ($key == "User-Agent") { $fpr{"useragent"} = $value; } elseif ($key == "Upgrade-Insecure-Requests") { $fpr{"upgradeinsecure"} = $value; } elseif ($key == "Host") { $fpr{"host"} = $value; } elseif ($key == "Dnt") { $fpr{"dnt"} = $value; } elseif ($key == "Connection") { $fpr{"connection"} = $value; } elseif ($key == "Cache-Control") { $fpr{"cachecontrol"} = $value; } elseif ($key == "Accept-Language") { $fpr{"acceptlanguage"} = $value; } elseif ($key == "Accept-Encoding") { $fpr{"acceptencoding"} = $value; } elseif ($key == "Accept") { $fpr{"accept"} = $value; } } class wwwdb extends SQLite3 { function __construct() { $this->open('/botnow/botnow.db'); } } $wwwdb = new wwwdb(); if(!$wwwdb) { echo $wwwdb->lastErrorMsg(); } else { foreach ($fpr as $key => $value) { $keys[] = $key; $values[] = $value; } $keystr = '"'.implode('","', $keys).'"'; $valstr = '"'.implode('","', $values).'"'; $sql =<<exec($sql)) { echo $db->lastErrorMsg(); return; } $sql =<<query($sql); while($row = $ret->fetchArray(SQLITE3_ASSOC)) { // echo "hash: $hash, row['hashid']: ".$row['hashid']."
\n"; if ($hash == $row['hashid']) { $captcha = $row['captcha']; // echo $captcha; } } $wwwdb->close(); // echo "Records created successfully\n"; } session_start(); // The capcha will be stored // for the session $_SESSION["captcha"] = $captcha; // Generate a 50x24 standard captcha image $im = imagecreatetruecolor(250, 120); // Blue color $bg = imagecolorallocate($im, 22, 86, 165); // White color $fg = imagecolorallocate($im, 255, 255, 255); // Give the image a blue background imagefill($im, 0, 0, $bg); // Print the captcha text in the image // with random position & size //imagestring($im, 5, rand(1, 40), rand(1, 40), $captcha, $fg); imagettftext($im , 96, 0, rand(0,130), 120-rand(0,60), $fg , 'intuitive.ttf', $captcha); //imagettftext($im , 96, 0, rand(20, 50), rand(20, 50), $fg , 'eczar.ttf', $captcha); // VERY IMPORTANT: Prevent any Browser Cache!! header("Cache-Control: no-store, no-cache, must-revalidate"); // The PHP-file will be rendered as image header('Content-type: image/png'); // Finally output the captcha as // PNG image the browser imagepng($im); // Free memory imagedestroy($im); ?>