Simple activation system
Posted: Wed Dec 05, 2007 5:12 am
My idea would be a simple activation system for a program.
the user enters his/her serial number and accordingly when the form is submitted, it returns the right activation code back.
So we have: database.php which holds the activation codes and serials:
and activate.php which is the action taken after the form submitted:
now, how can I make it if the user puts serial no. 2 in the form, that activation code no. 2 is returned to him, no. 3 serial gets no. 3 activation etc.
the user enters his/her serial number and accordingly when the form is submitted, it returns the right activation code back.
So we have: database.php which holds the activation codes and serials:
Code: Select all
<?php
//keys
$serialcode1="1kqwee";
$activcode1="1aaers";
$serialcode2="2rtyyr";
$activcode2="Sacfgd4";
$serialcode3="tefd34";
$activcode3="zdfrt21";
?>Code: Select all
<?php
include('database.php');
$getserial = $_POST['serial'];
if ($getserial==$serialcode1)
{
echo "<br><center>Your activation code is:<b> $activcode1</b>";
}
else
{
echo "<br><center><b>Serial not correct.</b><br><a href='javascript:history.back(-1)'>back</a>";
}
?>