Hello people. I have this script here:
<?
// Registration form processor
include ("common.inc.php");
if (!isset($conn)) {
$conn = dbConnect();
}
if (!$submit_cdkey) {
global $submit_cdkey;
global $process;
$process = 1;
$page = new FastTemplate (".");
$page->define(array("cdkeypage" => "cdkey.html"));
$page->assign("error", $error);
$page->assign("stepnumber", "Registration Step 1 of 4");
$page->assign("formaction", $PHP_SELF);
$page->parse("MAIN", "cdkeypage");
$page->FastPrint();
} else {
if ($process == 1) {
$cdkeyok = subkeyVerify($conn, $cdkey);
echo ("CDKEY Checked. CDKEYOK = ". $cdkeyok );
if ($cdkeyok == 2) {
$error = "<ul><li>You entered an invalid Registration Key. <br>Please try Again.</li></ul>";
$page = new FastTemplate (".");
$page->define(array("cdkeypage" => "cdkey.html"));
$submit_cdkey = FALSE;
$process = 1;
$page->assign("error", $error);
$page->assign("stepnumber", "Registration Step 1 of 4");
$page->assign("formaction", $PHP_SELF);
$page->parse("MAIN", "cdkeypage");
$page->FastPrint();
}elseif ($cdkeyok == 0) {
$error = "<ul><li>That Registration key is already in use. <br>Please try Again.</li></ul>";
$page = new FastTemplate (".");
$page->define(array("cdkeypage" => "cdkey.html"));
$submit_cdkey = FALSE;
$process = 1;
$page->assign("error", $error);
$page->assign("stepnumber", "Registration Step 1 of 4");
$page->assign("formaction", $PHP_SELF);
$page->parse("MAIN", "cdkeypage");
$page->FastPrint();
}else {
$process = 2;
echo ("Yeah. That's right. Display customer details now.");
}
echo ("We shouldn't be here.");
}
}
?>
The FastTemplate that is being called, is this:
<head>
<title>CD Key</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="styles.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="head">
<tr background="gfx/bakhead.gif">
<td background="gfx/bakhead.gif"><img src="gfx/funcomlogo.gif" width="135" height="73"></td>
<td background="gfx/bakhead.gif"> </td>
</tr>
</table>
<div class="stepnumber">{stepnumber}</div>
<form name ="form1" method="post" action="{formaction}">
<table width="75%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="50%">
<h2>CD Key</h2>
<div class="warning">{error}</div>
</td>
<td width="50%"> </td>
</tr>
</table>
<table width="75%" cellspacing="0" cellpadding="1" align="center">
<tr>
<td width="50%">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="desc">
<tr>
<td width="10%"> </td>
<td width="45%">
<h4>Cd Key</h4>
</td>
<td width="45%"> </td>
</tr>
<tr>
<td width="10%"> </td>
<td width="45%">
<input type="text" name="cdkey">
</td>
<td width="45%">
<input type="submit" name="submit_cdkey" value="Submit">
</td>
</tr>
<tr>
<td width="10%"> </td>
<td width="45%"> </td>
<td width="45%"> </td>
</tr>
</table>
</td>
<td width="50%" valign="top" class="about">This is the number found on the
game CD. Example #3454-23-sss-223</td>
</tr>
</table>
</form>
<p><a href="customerinfo.html">next</a></p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" class="copyright">
<div align="right">C O P Y R I G H T F U N C O M N V
2 0 0 1</div>
</td>
</tr>
</table>
</body>
Now, the problem is:
I run through it once, and it displays the page fine on the first run. I then submit a cdkey, ANY cdkey - (which is checked through a subroutine not shown here - subkeyVerify). The subroutine returns cdkey ok = 1, 2 or 0 depending on the outcome. That part works, I've checked it.
However, no matter what I put into the CDKEY field, the script turns up a blank page! (it submits to itself, as can be deducted from the script).
Something is wrong here....
Help?
Regards,
Henning Pedersen
Funcom Oslo AS