Script Register . change password

08/25/2012 02:44 adilwac#1
Hello

Please I need Registration Script in server Contains ..( username,password,Re password,email ) and I need script to change password in server ..

script = php

waiting for your help :)
08/25/2012 08:19 Masakratonis#2
heyho ,
i will upload it for you ;)

Register : [Only registered and activated users can see links. Click Here To Register...]
Thanks For NCarbon-Team for this Script !

Regards
Masakratonis
08/25/2012 11:10 adilwac#3
Quote:
Originally Posted by Masakratonis View Post
heyho ,
i will upload it for you ;)

Register : [Only registered and activated users can see links. Click Here To Register...]
Thanks For NCarbon-Team for this Script !

Regards
Masakratonis

Thx Masakra but this register page ..Without email :(
I need register page Contains ..( username,password,Re password,email )
08/25/2012 11:56 M>M#4
Quote:
Originally Posted by adilwac View Post
Thx Masakra but this register page ..Without email :(
I need register page Contains ..( username,password,Re password,email )
just edit the page to add a email option it's not so hard
08/25/2012 12:05 adilwac#5
Quote:
Originally Posted by M>M View Post
just edit the page to add a email option it's not so hard

I realy add email but where I Click create.. .is register for Success ..but the email in sql became all spaces ..

اتمنى تكون فهمتني حواس ..انا اضفت الايميل بنجاح و حين ادخله و اضغط تسجيل ...يتسوى الحساب بس حين اروح السكويل الاقي الايمل كله فراغات ما يروح الالميل الي كتبت في التسجيل ~~
اتمنى تساعدني لو تعرف ايضا في صفحة تغيير الباسوورد
08/25/2012 13:13 Masakratonis#6
Btw , i think , no one will give u his email , all players like write there , something like that: [Only registered and activated users can see links. Click Here To Register...]
08/25/2012 14:22 adilwac#7
up up up
08/25/2012 17:43 TheSuperKiller#8
if u dont know how to build simple php pages , then dont even think to build a server .
08/25/2012 18:10 adilwac#9
Quote:
Originally Posted by TheSuperKiller View Post
if u dont know how to build simple php pages , then dont even think to build a server .
I know ho to create register page .cont (user .password.repasswor)
but the email is always show problems
08/25/2012 18:22 M>M#10
Quote:
Originally Posted by adilwac View Post
I realy add email but where I Click create.. .is register for Success ..but the email in sql became all spaces ..

اتمنى تكون فهمتني حواس ..انا اضفت الايميل بنجاح و حين ادخله و اضغط تسجيل ...يتسوى الحساب بس حين اروح السكويل الاقي الايمل كله فراغات ما يروح الالميل الي كتبت في التسجيل ~~
اتمنى تساعدني لو تعرف ايضا في صفحة تغيير الباسوورد
did you edit the sql query in the index.php ?

you should also edit the php part and the html part in that file

then if you did edit them then you can use this function

Code:
$query = "INSERT Accounts( login_name,password,block,withdraw_remain_time,age ,auth_ok,pcbang,last_login_server_idx,event_code,result ,email) VALUES('$username','$converted_password',0,0,18,1,1,1,0,1,$email)";
just find the $query in you index.php file and change it to this query so you can add the email in the sql server

INFO: $email is the email option that you should already added it to the page


hope this can help you :D
08/25/2012 18:58 adilwac#11
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<title>Arcadia Test Server</title>
<?php
require("conf.php");
if ($registration ==0){
?>
				<h1>Registrations closed</h1>
			</div>
		</div>
<?php
exit;
}
if(isset($_SERVER['HTTP_REFERER']) 
	&& $_SERVER['HTTP_REFERER']!=''
	&& substr($_SERVER['HTTP_REFERER'], 7, strlen($_SERVER['SERVER_NAME'])) != $_SERVER['SERVER_NAME'])
	{
		$_POST = array();
		$_GET = array();
	}	
function connect(){
	require("conf.php");
	$db = $Auth_db;
	$connect = mssql_connect($sql_host, $sql_user, $sql_password);
	if (!$connect) {echo 'connection error'; exit;}
	mssql_select_db($db, $connect) or die("Couldn't open database $db"); 
	return $connect;
}
$do = $_POST['do'];
switch($do){
case "register":
$data_array = &$_POST;
$array_char = array("'","/","\\","*",":","!","?",".", "&", "%", "ù","^", "$", "=","¨","}","{","(",")","~","#","[","]","ç","à","é","€","§",";","¤","°","£","`","<",">");
$username = $data_array['name'];
$username = str_replace($array_char, "", $username);
$email = $data_array['email'];
$email = str_replace($array_char, "", $email);
$password = $data_array['pwd'];
$password = str_replace($array_char, "", $password);
$passwordconf = $data_array['pwdconf'];		
$passwordconf = str_replace($array_char, "", $passwordconf);
$combine_password = $md5_key.$password;
$converted_password = md5($combine_password);
if ($password != $passwordconf){
echo "<span style=\"color:red\">Passwords don't match !</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strlen($username) <= 5){
echo "<span style=\"color:red\">You need 5 characters at least in your account name</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}

if (strlen($password) <= 6){
echo "<span style=\"color:red\">You need 5 characters at least in your account password</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
} 
if (strstr ($username, " ") !== False){
echo "<span style=\"color:red\">You need to use alpha/numeric characters! </br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
if (strstr ($password, " ") !== False){
echo "<span style=\"color:red\">You need to use alpha/numeric characters! </br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
$db = connect();
$query_check ="SELECT login_name from Accounts WHERE login_name='$username'";
$query = "INSERT Accounts( login_name,password,block,withdraw_remain_time,age ,auth_ok,pcbang,last_login_server_idx,event_code,result,email ) VALUES('$username','$converted_password',0,0,18,1,1,1,0,1,'$email')";
$query_total = mssql_query("SELECT count(account_id) FROM Accounts");
$results_check = mssql_query($query_check);
$results_total = mssql_fetch_row($query_total);
$result_total = $results_total['0'];
if ($result_total >= $max_accounts){
echo "<span style=\"color:red\">Max accounts limit has been reached, sorry..</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
while ($row_check = mssql_fetch_array($results_check)){
$check_username = $row_check['login_name'];
}
if ($check_username == $username){
echo "<span style=\"color:red\">Account already exist!</br><a href=\"javascript:refreshpage()\">Back</a></span>";
exit;
}
else
$results = mssql_query($query);
echo "Success, you can now download the launcher</br><a href=\"launcher.exe\">Here</a>, <br />and <a href=\"client.zip\">Client Here</a>";
break;
}
?>
		<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
		<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
		<script type="text/javascript">
			function refreshpage() 
			{ 
				setTimeout("location.reload(true);",20); 
			}
			$(document).ready( function () 
			{ 
			$("#register").submit( function() 
				{	// à la soumission du formulaire						 
					$.ajax(
					{ // fonction permettant de faire de lajax
						type: "POST", // methode de transmission des données au fichier php
						url: "index.php", // url du fichier php
						data: "do=register&"+"name="+$("#name").val()+"&pwd="+$("#pwd").val()+"&pwdconf="+$("#pwdconf").val(),// données à transmettre
						success: function(msg)
						{ // si lappel a bien fonctionné							
							if (msg)
							{							
								$("div#connexion").hide().fadeIn(1200).html(msg);
							}
							else
							{
								$("div#erreur").hide().fadeIn(1200).fadeOut(5200).html("<p style=\"color:red\"><img src=\"../client/help/img/error.png\" width=\"20px\" heigth=\"20px\"/>&nbsp;An error occured</p></br>");
							}
						}
					});
					return false; // permet de rester sur la même page à la soumission du formulaire
				});
			});
			$(document).ready(function()
			{
				$("#loadpage").fadeIn(920);
			});
	</script>
	</head>
	<body>
		<div id="loadpage" style="display:none">
			<noscript><div id="loadpage"></div></noscript>
			<div style="text-align: center; width: 100%; margin-top: 150px;">
			<p>
				<img src="logo.png" alt="Arcadia Dev"><br /><h2>NCarbon for Arcadia Dev</h2><br /><br />
			</p>
					<div id="connexion">
			<form name="register" id="register" action="#" class="main_form"><!-- Form begin -->   
				<div class="main_form">
					<label for="name">Username</label>
					<div class="div_textbox">
						<input type="text" name="name" id="name" /><!-- Login Value -->
					</div>
				</div>
				<div class="main_form">
					<label for="pwd">Password</label>
					<div class="div_textbox"><!-- Password Field -->
						<input type="password" name="pwd" id="pwd" />
					</div>
				</div>
				<div class="main_form">
					<label for="pwdconf">Confirm password</label>
					<div class="div_textbox">
						<input type="password" name="pwdconf" id="pwdconf" /></br>
					</div>
				</div>
				<div class="main_form">
					<label for="email">email</label>
					<div class="div_textbox">
						<input type="text" name="email" id="email" />
					</div>
				</div>
				<div class="clear"></div>
				<p style="text-align: center; margin: auto; margin-top: 10px;">
					<!-- Submit Button -->
					<input type="submit" value="Create Account" style="margin: auto;" />
				</p>
			</form><!-- End of form -->
		</div></br>
		<div id="erreur"></div><!-- span qui contiendra les éventuels messages derreur -->
		<span id="confirmMsg"></span>
	</div></div><i>Don't use special char in your password or username, it will be deleted by our internal security system</i></br>
This modified for me What's wrong ?
and the config is correct 100 %
08/25/2012 21:38 Xijezu#12
Quote:
Originally Posted by M>M View Post
Code:
$query = "INSERT Accounts( login_name,password,block,withdraw_remain_time,age ,auth_ok,pcbang,last_login_server_idx,event_code,result ,email) VALUES('$username','$converted_password',0,0,18,1,1,1,0,1,$email)";
You know that this wont work since the Accounts-Table doesn't has an email-column?
First of all you'll have to add it to the database, then you can think about that email-thing.
08/25/2012 22:09 adilwac#13
Quote:
Originally Posted by Xijezu View Post
You know that this wont work since the Accounts-Table doesn't has an email-column?
First of all you'll have to add it to the database, then you can think about that email-thing.
the email-colum is existing in the accounts-Table in Auth database
and this is a design for my Acoount-Table in database
Code:
account_id
login_name
password
block
withdraw_remain_time
age
auth_ok
pcbang
last_login_server_idx
event_code
server_list_mask
result
ip
game_code
gamecode
email
e-mail
08/25/2012 22:38 M>M#14
Quote:
Originally Posted by Xijezu View Post
You know that this wont work since the Accounts-Table doesn't has an email-column?
First of all you'll have to add it to the database, then you can think about that email-thing.
WTF!

the Account-Table have a Email column
08/25/2012 22:43 Xijezu#15
Quote:
Originally Posted by M>M View Post
WTF!

the Account-Table have a Email column
The Original one NEVER had one...