<html>
<head>
<title> Key Generation Page</title>
<style type="text/css">
body{
display: block;
margin: 0 auto;
width: 60%;
text-align: center;
margin-top: 2%;
}
.box{
display: block;
margin: 0 auto;
width: 400px;
border: 1px solid #D6D6D6;
background-color: #F3F3F3;
height: auto;
padding: 20px;
}
h1{
font-family: sans-serif;
font-size: 20px;
color: olive;
}
.code{
font-family: sans-serif;
font-size: 50px;
color: green;
}
.textbox {
display:block;
padding: 5px;
width: 250px;
float:left;
margin-right: 10px;
}
.btn {
display:block;
width: 100px;
float:left;
border: solid 1px #ECEAE8;
padding: 4px;
}
.success {
display:block;
width: 350px;
border: solid 1px #ECEAE8;
padding: 4px;
background-color: green;
color: white;
font-size: 15px;
margin-top: 2px;
font-weight: bold;
}
.error {
display:block;
width: 300px;
border: solid 1px #ECEAE8;
padding: 4px;
background-color:red;
color: white;
font-size: 15px;
margin-top: 10px;
font-weight: bold;
}
</style>
</head>
<body>
<?php
include "my_class.php";
?>
<h1> Please Enter Code Here : -</h1>
<div class="box">
<form action="keygenerator.php?action=addkey" method="post">
<input name="code" type="text" class="textbox" />
<input type="submit" value="Generate" class="btn" />
</form>
<?php
$get_key = new my_keys();
if(isset($_GET['action'])=='getcode'){
$code = $_POST['code'];
if($code==''){echo "<br><div class='error'>Sorry blank records can't be added.</div>";} else {
$getkey = $get_key->generatekeybycode($code);
echo "<br><div class='success'>The key is <br>" . $getkey . "</div>";
}}
else{echo "";}
?>
</div>
</body>
</html>
|