Doesn't show the script


#1

The website doesn’t show register only Registration is closed. Someone can help me? i want open registration. :wink:

[php]<?php
if (ALLOW_OPEN != 1){
exit(“You can’t open this site directly”);
}
?>

<?php mssql_select_db($kal_auth); function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } function encode($password) { $encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E' ,'\''=>'BB', '('=>'C0', ')'=>'7F','*'=>'18', '+'=>'70', ','=>'A6' ,'-'=>'E2', '.'=>'EC', '/'=>'77','0'=>'2C', '1'=>'3A', '2'=>'4A' ,'3'=>'91', '4'=>'5D', '5'=>'7A','6'=>'29', '7'=>'BC', '8'=>'6E' ,'9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72' ,'?'=>'9C','@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B' ,'E'=>'50','F'=>'51', 'G'=>'6D', 'H'=>'E9','I'=>'9A', 'J'=>'B8' ,'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE' ,'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89' ,'V'=>'7B', 'W'=>'A2', 'X'=>'AD','Y'=>'71', 'Z'=>'E3', '['=>'D5' ,'\\'=>'BF', ']'=>'53', '^'=>'28','_'=>'44' ,'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F' ,'f'=>'94', 'g'=>'12', 'h'=>'73' ,'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D' ,'o'=>'7D','p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79' ,'u'=>'0B','v'=>'D6', 'w'=>'23', 'x'=>'7C' ,'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62'); $newpass = '0x'; for ($i = 0; $i < strlen($password); $i++) { $newpass .= $encar[$password[$i]]; } return $newpass; } function CreateString($p_iChrs){ if(!is_Numeric($p_iChrs)){ $p_iChrs = 15; } // Initialiseren van de waarden $sReturn=''; // initialiseer de string. $aInteger = range('0','9'); // Array 0 tot en met 9 $aAlpha = range('a','z'); // Array a t/m z $aAlphaC = range('A','Z'); // Array A t/m Z // Haal nummers, letters en hoofdletters uitelkaar en maak nieuwe array. $aChrs = array_merge($aInteger, $aAlpha, $aAlphaC); // Als de je array nog even wil bekijken haal dan de # weg. # print_r($aChrs); // Genereer de random string :) for($cnt=0;$cnt<$p_iChrs;$cnt++){ $sReturn.= $aChrs[rand(0,count($aChrs)-1)]; } return $sReturn; } $unix = 2325368800; if((1 == 0 || time() > $unix) OR isset($_GET['early'])) { if(isset($_POST['sub'])) { //SQL Injection check foreach($_POST as $key => $val) { $val = strtoupper(trim($val)); //echo '$_POST['.$key.'] = '.$val.'
'; if(!ctype_alnum($val) and $key <> 'KalEmail' and $key <> 'KalEmail2'and $key <> 'sub') { $error = "You cannot use special characters such as *, /, ?, =, <, >, -, ! or a space"; die("Illegal input detected in post variable \"".$key."\" with value ".$val.". The administrator has been notified."); //die($error); //die("You cannot use special characters such as *, /, # or ?"); } } //Define posted variables $login = ereg_replace("[^A-Za-z0-9]", "", $_POST['KalLogin']); $password = ereg_replace("[^A-Za-z0-9]", "", $_POST['KalPassword']); $password2 = ereg_replace("[^A-Za-z0-9]", "", $_POST['KalPassword2']); $email = $_POST['KalEmail']; $email2 = $_POST['KalEmail2']; //Checking post variables $sql = mssql_num_rows(mssql_query("SELECT UID FROM Login WHERE ID='".$login."'")); //check is username already exists if($sql > 0) { $error = "Username already in use."; include 'pages/register/failed.php'; } else { if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) { unset($_SESSION['security_code']); if($email == $email2) { if (check_email_address($email)) { if($password == $password2) { if((strlen($login) >= 4) AND (strlen($login) <= 10)) //check length login { if((strlen($password) >= 5) AND (strlen($password) <= 8)) //check length pw { $sql2 = mssql_num_rows(mssql_query("SELECT * FROM LoginExtend WHERE UserEmail='".$email."'")); if($sql2 < 3) { $pass = encode($password); mssql_query("INSERT INTO Login(ID, PWD, Birth, Type, ExpTime) VALUES ('".$login."', ".$pass.", '19190101', '1', '4000')"); $lastuid = mssql_fetch_array(mssql_query("Select TOP 1 UID from Login order by UID desc")); $uid = $lastuid['UID']; $string = CreateString(15); echo 'Your account has been successfully made. Before you can login, you need to activate your account.
You have received an email with an activation key, please follow the instructions.

Sending activation e-mail........
'; mssql_query("INSERT INTO LoginExtend(UID, UserEmail, UserRegIP, UserLastIP, UserLoginAttempt, UserLastLoginDate, ActivationKey, Server, StarterPoints) VALUES(".$uid.", '".$email."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', -1, GETDATE(), '".$string."', '0', 20)"); require $root_url.'/mailer2.php?type=activation&pw='.$password.'&id='.$login.'&email='.$email.'&key='.$string; echo '
If you didn\'t receive the activation email, click here to resend'; } else { $error = "There are already 2 accounts on this e-mail address"; include 'pages/register/failed.php'; } } else { $error = "Password is too long/short! Min. 5 chars, max. 8"; include 'pages/register/failed.php'; } } else { $error = "Username is too long/short! Min. 4 chars, max. 10"; include 'pages/register/failed.php'; } } else { $error = "Passwords do not match"; include 'pages/register/failed.php'; } } else { $error = "Email is not valid."; include 'pages/register/failed.php'; } } else { $error = "Emails do not match"; include 'pages/register/failed.php'; } } else { $error = "Wrong security code"; include 'pages/register/failed.php'; } } } else { echo ""; echo ""; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; //echo " "; //echo " "; //echo " "; //echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; /* ?>
			<script language="JavaScript" type="text/javascript">

var frmvalidator = new Validator(“form1”);
frmvalidator.EnableMsgsTogether();
frmvalidator.addValidation(“KalLogin”,“req”,“Please enter your Login name”);
frmvalidator.addValidation(“KalLogin”,“maxlen=10”,“Max length for Login name is 10”);
frmvalidator.addValidation(“KalLogin”,“minlen=4”,“Min length for Login name is 4”);
frmvalidator.addValidation(“KalLogin”,“alphanum”,“Special characters are not allowed for Login name”);

frmvalidator.addValidation(“KalPassword”,“req”,“Please enter your Password”);
frmvalidator.addValidation(“KalPassword2”,“req”,“Please repeat your Password”);
frmvalidator.addValidation(“KalPassword”,“maxlen=8”,“Max length for Password is 8”);
frmvalidator.addValidation(“KalPassword2”,“maxlen=8”,“Max length for Password is 8”);
frmvalidator.addValidation(“KalPassword”,“minlen=5”,“Min length for Password is 5”);
frmvalidator.addValidation(“KalPassword2”,“minlen=5”,“Min length for Password is 5”);

frmvalidator.addValidation(“KalEmail”,“email”,“Email is not valid”);
frmvalidator.addValidation(“KalEmail2”,“email”,“Repeated Email is not valid”);
frmvalidator.addValidation(“KalEmail”,“req”,“Please enter your Email”);
frmvalidator.addValidation(“security_code”,“req”,“Please enter the Security code”);
frmvalidator.addValidation(“KalEmail2”,“req”,“Please repeat your Email”);

<?php
*/
echo “

Login name: (min[4], max[10])
 
Login password: (min[5], max[8])
Re-type password: (min[5], max[8])
 
Your email:
Re-type email:
 
Terms of Service"; /* Server rules 1. Accounts The GM-team is not responsible for you losing your secret number, password or ID. In certain cases you may be able to retrieve your secret number or password by using the User Panel. Trading accounts or items for other servers is FORBIDDEN. We don't help scammed players in this case. Attempting to sell accounts or items for real money (eBay, PayPal, ...) is strictly FORBIDDEN. Sharing accounts or items is AT OWN RISK. We will never restore items when we find out you gave away your PW/ID or used the same ID/PW info on another server. 2. Scamming If your character is shared and is found "empty", we will not restore items. Sharing is a risk you take so only share with somebody you know well. If your character is shared and is found "empty", the players on which the items are now, will not be blocked. If you won't bother keeping the account for yourself, we won't bother spending time finding who took your stuff and block him. If you get scammed while trading items/accounts for another server, we will not restore the account/items because we cannot verify if the transaction occured on the other server or not. Keeping drops in party cannot be considered scamming. Don't party players that you don't know, and if you do, make a droprule like finders-keepers. 3. Insulting Insulting is not the way to play a game. If you are found excessively insulting (the GM in question may decide whether the insults were excessive or not), you risk getting a number of warnings. When you have 3 warnings, your account will be blocked for 1 week. When the insults are over the top, like racial/sexual insults, we can decide to block your account for 3 to 7 days. Insulting a GM will immediately get you blocked for the amount of days the GM in question feels appropriate (1 day up to permanent). 4. RB-Killing It is very hard to prohibit RB-Killing because of the many different cases, but generally please try to think of the other player's feelings, even if you don't like them. 5. Hacking Hacking in any way (2 jobs, storms, speed, etc) will get you banned and IP banned permanently. So think about the people in your area that play on the same IP or range (e.g. Internet caf?). UCEs are not allowed when playing on SwordOnline. Even if they are attached to another process, you will get automatically banned by GBL and unban is impossible. You will also get banned on Hardware ID through GBL. This means you will not be able to play on any server supported by K2O with your computer, even if your IP changes. 6. GM Impersonators There are always people trying to ruin the fun for others. There may be people that tell you they are GM's and ask for your items or id and password. Do not trust these people! A real GM will never ask you to give your items to him/her. We also will not ask you for your login data, if we need them, we can get them without asking. If you get scammed by these people we can not help you. We do expect a certain level of intelligence from the players here. We hold the right to block players with names that match GM names but with capitals in other places. (e.g. GM: junk, Impersonator: junK) 7. Update notifications Server news or required updates will be posted in Notices on the forum and on the homepage. Shoutspammed URLs ingame are not ours. 8. GameMasters GMs do not play active on this server that means: No GMs in war, no GMs as assassin, no players with stuff from GMs, no player who levels together with GMs in party and no GMs which help to make better weapons. If you discover (and can prove) that a GM is helping a player with items, please report this to Bjorn using the forum's Mail function as soon as possible. 9. Assassin drops Assassin drops don't have to be given back! Free PVP drops MUST be given back within the hour, if not, you will be banned. 10. AFK-splashying AFK-splashying is not allowed! If we catch you doing it, you will be banned permanently, even if you are not using any illegal program to do it. 11. Advertising Advertising other servers, in any way, is forbidden! You will be IP/HID banned permanently. */ //echo "
  I agree to the server rules
 &nbsp
 

* Max. 2 accounts per e-mail are allowed
”;
}
}
else
{
echo “Registration is closed.”;
}
?>[/php]

#2

Well, one thing i see is that first if statement after the functions - 1 will never equal 0, its not possible. This could be your problem as to why its giving you that message.

Also, on your email validation, its not taking into consideration that there might be more than 1 period after the @. There are emails that end in an octet, like @abc.def.com. It’ll fail on those… I’m not sure if this - ‘\’ - is valid. it might think you’re trying to escape the last quote, dreamweaver did.

its good to see someone applying tab standards, makes it easier to figure out what’s going on. But i think you’re missing the last end brace (or that’s not all of the code, can’t be sure). I loaded it into dreamweaver and after fixing the really bad copying job this does, i was one short at the end.