Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > 4Story
You last visited: Today at 20:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Registration Problem

Discussion on Registration Problem within the 4Story forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2015
Posts: 52
Received Thanks: 12
Registration Problem

Hey Leute habe ein Problem..

Ich kann leider keine Accounts erstellen über mein Registration script...

bekomme diese Fehler:



Account Tabelle:




PHP CODE:

Code:
<?php
	if(isloggedin($_POST['username']))
	{
		echo "<div class='alert alert-error'>You are already logged in!</div>";
	}
	else
	{
	if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['passwordagain']) && isset($_POST['email']))
	{
		if(!empty($_POST['username']) && !empty($_POST['password']) && !empty($_POST['passwordagain']) && !empty($_POST['email']))
		{
			//defineing variables
			$username = $_POST['username'];
			$password = $_POST['password'];
			$passwordagain = $_POST['passwordagain'];
			$email = $_POST['email'];
			if(ctype_alnum($username) && ctype_alnum($password) && ctype_alnum($passwordagain) && filter_var($email, FILTER_VALIDATE_EMAIL))
			{
				if(strlen($username)>=6 && strlen($password)>=6 && strlen($passwordagain)>=6 && strlen($email)>=6)
				{
					//passwords match
					if($password == $passwordagain)
					{
						$emailexistcommand = "SELECT * FROM TACCOUNT WHERE szMail = '$email'";
						$emailexistquery = odbc_exec($TGLOBALdatabase, $emailexistcommand);
						if(!odbc_num_rows($emailexistquery))
						{
							$userexistcommand = "SELECT * FROM TACCOUNT WHERE szUserID = '$username'";
							$userexistquery = odbc_exec($TGLOBALdatabase, $userexistcommand);
							if(!odbc_num_rows($userexistquery))
							{
								$salt = generateSalt();
								$userregistercommand = "INSERT INTO TACCOUNT (szUserID, szPasswd, bCheck, szSalt, szMail, dwActive, dwAdmin) VALUES (?, ?, ?, ?, ?, ?, ?)";
								$userregisterprepare = odbc_prepare($TGLOBALdatabase, $userregistercommand);
								$userregisterquery = odbc_execute($userregisterprepare, array($username,$password,0,$salt,$email, 0, 0));
								$userquerycommand = "SELECT * FROM TACCOUNT WHERE szUserID = '$username'";
								$userquery = odbc_exec($TGLOBALdatabase, $userquerycommand);
								$userinfo = odbc_fetch_array($userquery);
								$userid = $userinfo['dwUserID'];
								$usercashcommand = "INSERT INTO TCASHTESTTABLE (dwUserID, dwCash, dwBonus) VALUES (?, ?, ?)";
								$usercashprepare = odbc_prepare($TGLOBALdatabase, $usercashcommand);
								$usercashquery = odbc_execute($usercashprepare, array($userid, 0, 0));
								addItem($userid,9,10);
								addItem($userid,66,5);
								addItem($userid,100,3);
								addItem($userid,96,2);
								addItem($userid,330,3);
								mail($email, '4Story - Register - NoReply', 'You have succesfully registred an account!To activate your account please visit:http://localhost/account/validate.php?id=' . $userinfo['dwUserID'] . '&code=' . $salt);
								echo "<div class='alert alert-success'>You succesfully registred!We sent the activation email to your emailTo activate your account please visit: <a href='http://localhost/account/validate.php?id=" . $userinfo['dwUserID'] . "&code=" . $salt . "'>this</a></div>";
							}
							else
							{
								echo "<div class='alert alert-error'>This username is already taken!</div>";
							}
						}
						else
						{
							echo "<div class='alert alert-error'>This email is already taken!</div>";
						}
					}
					else
					{
						echo "<div class='alert alert-error'>Passwords must match!</div>";
					}
				}
				else
				{
					echo "<div class='alert alert-error'>Username and password must be more than 6 characters!</div>";
				}
			}
			else
			{
				echo "<div class='alert alert-error'>You can use only alphanumerical characters!</div>";
			}
		}
		else
		{
			echo "<div class='alert alert-error'>You must fill in everything!</div>";
		}
	}
	echo '<form id="login" action="/account/register.php" method="POST">
	<input name="username" type="text" placeholder="Username" class="account"></input><small>*Must be at least 6 characters long and alphanumeric</small><br \>
	<input name="password" type="password" placeholder="Password" class="account"></input><small>*Must be at least 6 characters long and alphanumeric</small><br \>
	<input name="passwordagain" type="password" placeholder="Password again" class="account"></input><small>*Must match with first password</small><br \>
	<input name="email" type="text" placeholder="E-mail" class="account"></input><small>*Must be a valid email address</small><br \>
	<input type="submit" class="registerbtn" style="float:left;margin-left:20px;" value="submit" class="submit" /><br \>
	</form>';
	}
?>
npolkey is offline  
Reply


Similar Threads Similar Threads
registration problem
12/23/2013 - Shaiya PServer Development - 0 Replies
Hi, Wenn jemand ein Account erstellt, wird in die db die useruid nicht eingetragen. Weiß vllt jemand wie ich das fixen kann? Ich habe schon alles mögliche probiert. RowID gelöscht, Userdata mit einer anderen ausgetauscht von einer anderen db. Aber nichts hat geholfen. Wäre echt nett wenn mir jemand helfen würde. When someone create a account. UserUid dont entered in the Database. I hope anyone can help me. Greez riderz1 USE GO /****** Object: Table . Script Date: 12/23/2013...
Problem bei der Registration
05/25/2013 - Infestation - 3 Replies
Hallo, ich habe mir WarZ über Steam gekauft ... nun will ich mich registrieren aber da taucht folgender fehler auf: Bitte benutze deinen existierenden Account von The WarZ um unter Steam spielen zu können. Ich habe aber keinen Account gemacht ? Wäre nett wenn mir jemand helfen kann
The problem with the registration of
02/17/2013 - Dekaron Private Server - 1 Replies
hello I have a problem with rejestracjaa say, I have everything Dekaron server to be configured: sql, odbc files to rejestracjiczyli in config.php and all I register.php file configured properly and when trying to register it after you try to click on create account, nothing history does not record me takes me to another page just like a page would not press the button to have the system check mark on the sql Microsoft.Windows.Server.2008.R2.Enterprise.x64.SP 1 to.Microsoft.SQL.Server.2008 ....
KTS registration problem
02/13/2011 - Rappelz - 2 Replies
Hi, I trying register and I can't because when I complete all, appears this: 자동가입방지 문자를 정확히 입력해주세요 (Please enter the characters exactly prevent automated up) http://img7.imageshack.us/img7/9462/wtfpc.jpg I tried 20+ times and nothing, please help.
Registration problem
01/25/2010 - Dekaron Private Server - 5 Replies
Ok. Different problem now. I have the web files for the registration page, however my apache xampp install is on a different drive because I am running a website currently. Is there a way to put the registration file on that drive and make it point at the databases that are on a separate drive?



All times are GMT +2. The time now is 20:56.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.