<?PHP
#	I am starting life as cmd6.cmd.  I validate the code returned by the user from the email that we sent out in  cmd4.cmd.

	$valcode=tapRequest("valcode");
	if (!array_key_exists("valcode",$_SESSION))
	{
		$newby=4;
		$errmsgs.=addError("You have not gotten a validation code from us yet (or at least recently.  Try giving us your email address below.");
	}
	if (is_null($valcode))
	{
		$newby=4;
		$errmsgs.=addError("You need to give us the validation code from the email we sent you.");
	}
	else
	{
		if ($valcode == $_SESSION["valcode"])
		{
			$_SESSION["validemail"]=true;
		}
		else
		{
			$newby=4;
			$errmsgs.=addError("Your input did not match the validation code we sent to you.  Try again.");
		}
	}
?>