SpellcasterDX
Yes, once more I need help fixing my file. I get a
That's the error I get. And this is the file in question:
| Code: |
| Parse error: syntax error, unexpected T_ELSE in /home/spellcas/domains/sdx.frih.net/public_html/boards/registration2.php on line 138 |
That's the error I get. And this is the file in question:
| Quote: |
| <?
$starttime = microtime(); include("common.php"); $navigation[] = array("name" => "User Registration", "url" => "$PHP_SELF"); global $EmailConfirm; global $AllowRegisters; if ($AllowRegisters) { if($userloggedin){ $output = "You are already registered."; }else{ if ($action == "create") { $sql = "SELECT code FROM ".TABLE_SECURITY_CODE." WHERE id = 1"; if($exe = runQuery($sql)){ $row = fetchResultArray($exe); } if ($code !== $row[code]) { $err[] = "Incorrect security code"; } if (!$displayname) { $err[] = "No display name was entered"; } else { if ($action == "create") { if (!$displayname) { $err[] = "No display name was entered"; } else { // Check for invalid characters in the displayname $notallowedchars = "[^a-zA-Z0-9\.\_\+-]"; if (ereg($notallowedchars, $displayname)) { $err[] = "Your display name contains invalid characters"; } } if (!$firstname) { $err[] = "No first name was entered"; } if (!$lastname) { $err[] = "No last name was entered"; } if ($password1 != $password2) { $err[] = "The two passwords do not match. Please re-enter them."; } if (!$email) { $err[] = "No email address was entered"; } if (!$security) { $err[] = "The security code entered is incorrect. Please re-enter it."; } if (!$_POST['tos']) { $err[] = "You Did Not Agree To The Terms Of Service And Therefore Cannot Register Until You Do"; } else { $validemail = validEmail($email); if ($validemail == "invalid-form") { $err[] = "Your email address is malformed"; } if ($validemail == "invalid-mx") { $err[] = "Your email address cannot be reached"; } if (countUserEmails($email) > 0) { $err[] = "The email address you supplied is already in use."; } } if (!$birthdayyear) { $err[] = "No birthday year was entered"; } else { if (!checkdate($birthdaymonth, $birthdayday, $birthdayyear)) { $err[] = "The birthday entered was invalid"; } } if ($err) { // Errors were encountered, stop... $reason = implode("<BR>\n", $err); $action = ""; } else { // No errors, go ahead $data[displayname] = $displayname; $data[firstname] = $firstname; $data[lastname] = $lastname; $data[email] = $email; $data[country] = $country; $data[birthday] = mkTime(0, 0, 0, $birthdaymonth, $birthdayday, $birthdayyear); $data[gender] = $gender; $data[ipaddress] = $REMOTE_ADDR; $data[password1] = $password1; $data[password2] = $password2; $data[security] = $security; // print_r($data); $user = createUser($data); if ($user) { // User creation worked if ($EmailConfirm) { $output = "Thank you. Your account has been created.\n" ."<P>\n" ."Login information has been emailed to your supplied email \n" ."address, $email.\n" ."<P>\n" .makeLink($returnurl, "Continue using $DiscoBoardName"); } if (!$EmailConfirm) { $output = "Thank you. Your account has been created.\n" ."<P>\n" ."Here is your account information:<BR><BR>" ."<B>Username: </B>".$displayname."<BR>" ."<B>Password: </B>".$user ."<P>" .makeLink($returnurl, "Continue using $DiscoBoardName"); } } } } if (!$action) { if ($reason) { $reasonoutput = "<B CLASS='red'>".$reason."</B>\n" ."<P>\n"; } $mandatory = "<SPAN CLASS='red'>•</SPAN>"; include("elements/newuser.php"); $output = "Please complete the form below to register to use the system.<BR>\n" ."Required fields are marked: ".$mandatory."<BR>\n" ."<P>\n" .$reasonoutput ."<FORM ACTION='$PHP_SELF' METHOD=POST>\n" .inputHidden("action", "create") .inputHidden("returnurl", $returnurl) .$userform ."<P>\n" ."<INPUT TYPE=\"SUBMIT\" onClick='this.value = \"Processing... Please wait...\";this.disabled = true;this.form.submit();' VALUE=' Register ' CLASS='button' NAME='Register'>" ."</FORM>\n"; } } else { $output = "Registrations aren't allowed at the moment. Please try again later."; } $output = "<TABLE WIDTH=100% CELLPADDING=20 CELLSPACING=1 BORDER=0>\n" ."<TR><TD CLASS='BoardRowBody'>\n" ." ".str_replace("\n", "\n ", $output)."</TD></TR>\n" ."</TABLE>\n"; $pagecontents = $output; include("layout.php"); ?> |
