Is there anything glaringly obviously wrong here?
Posted: Fri Apr 27, 2007 11:20 am
For whatever reason, if I uncomment this code I get a blank page for the entire file, even though error reporting is turned on to full.
I'm new to the exception handling stuff, so I'm abit clueless.
Code: Select all
case 'registering' :
try {
if($_POST['email'] != $_POST['email2'])
{throw new customException('Email 1 did not match email 2.');}
if($_POST['password'] != $_POST['password2'])
{throw new customException('Password 1 did not match Password 2.');}
if($_POST['username'] == '')
{throw new customException('You did not enter a username.');}
if(!eregi("^([a-z0-9]+)([._-]([a-z0-9]+))*[@]([a-z0-9]+)([._-]([a-z0-9]+))*[.]([a-z0-9]){2}([a-z0-9])?$", $_POST['email']))
{throw new customException('myemail@mydomian.com is an example of a working email address.');}
}
$userId = User::Register($_POST['username'], $_POST['password'], $_POST['email']);
mail($_POST['email'], 'You have now registered', 'Welcome '.$_POST['username'].', your userid is '.$userId->id, "From: ". $admin_email);
$smarty->assign('page_title', $titlebegin.' Registered');
$smarty->assign('message','You have successfully registered, you may now access the private area.');
$smarty->assign('page_include','success.tpl');
$smarty->display('index.tpl');
catch (customException $e)
{$smarty->assign($_POST);
$smarty->assign('page_title', $titlebegin.' Register');
$smarty->assign('page_include', 'register.tpl');
$smarty->display('index.tpl');}
break;