Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Registration Script

Newbie Spellweaver
Joined
Feb 6, 2009
Messages
74
Reaction score
22
[Release] Registration Script (ODBC)

Heres the new register Script with ODBC Connection instead of Mssql

Have fun

FileUpload:

-----------

If you get some SET IDENTITY INSERT OFF Error than just delete on Line 38
AccountUniqueNumber, and '$n', (delete the decimal point too). This Error is because your AccountUniqueNumber Field is set to "AutoIncrement"

Hope this helps a bit

If you want to AutoIncrement instead of the accounts.txt then have a look here:
 
Last edited:
Initiate Mage
Joined
Nov 13, 2010
Messages
1
Reaction score
0
Hey Folks,

Heres my Registration Script for you guys who dont want or dont know how to do that.

Just edit the config.php, index.php and register.php (its a copy from index.php)

Have fun !


Works with MSSQL 2008 RC2 maybe with 2005 i dont know

This Registration Script will work perfect with your own Webserver.
But if you have a Webhoster, then ask your Provider to enable MSSQL Extension.

Also copy this to your 'config.php' with your data to get this script running if you want to run it on a Webhoster:



Remember that '9979' is your MSSQL Port. If you didnt changed the Port than type 1433

em, gamesever is allright,but the registration system wiht your script isn't work fine。
MSSQL2008, PHP, APACHE
above that,need any other software esle?
 
Experienced Elementalist
Joined
May 9, 2011
Messages
222
Reaction score
34
Humm hack maybe not,if you call the registration script by another way that can be ok i think
 
Newbie Spellweaver
Joined
Feb 24, 2010
Messages
22
Reaction score
2
Hey friend i have modify files registration by ace online ep 3.3.
This script, work in windows server dedicated and xampp installed (apache running).

files:
config.php:
Code:
<?php
$server = 'localhost';
$dbhandle = mssql_connect('195.36.2.11,1433', 'atum', 'callweb')//change ip and user and pass!
or die("Couldn't connect to SQL Server on $myServer");
  ?>
This is important configuration file by sincronization mssql database.
------------------------
index.php:
Code:
<HTML>
	<HEAD>
		<TITLE>Registration</TITLE>
		<STYLE>
			body	{
				background-image: url(bg.jpg);
				background-repeat: no-repeat;
				background-position: top center;
				display: block;
				width: 1280px;
				background-color:  black;
				color: white;
				margin: auto;
			}
		</STYLE>
	</HEAD>
	<BODY>
<?php	
if (!strstr($_SERVER["HTTP_USER_AGENT"], "Opera") && strstr($_SERVER["HTTP_USER_AGENT"], "MSIE")){
?>
<div style="margin-top: 250px; border: 2px solid blue; background-color: black; color: white; width: 600px; margin-left: 500px;" align="center">
<?php } else { ?>
<div style="margin-top: 150px; border: 2px solid blue; background-color: black; color: white; width: 500px; margin-left: 350px;" align="center">
<?php } ?>
<div align="center"><h1>Registrazione al gioco</h1></div>
			<?php
			include 'config.php';    
			
			$online=mssql_num_rows(mssql_query("SELECT ConnectingServerGroupID FROM atum2_db_account.dbo.td_Account WHERE ConnectingServerGroupID = '0'"));
mssql_close($dbhandle);;
echo "<div align='center'> Attualmente vi sono ".$online." account registrati.</div>";
$sql2 = "SELECT * FROM [atum2_db_1].[dbo].[td_Character]";
   $ergebnis = mssql_query($sql2);
while($row = mssql_fetch_object($ergebnis))
   {

   ##### Nation Translation ###
   $nation = $row->InfluenceType;
   if ($nation == '1') {	$bcu++;		}
   if ($nation == '2') {	$ani++;		}
   if ($nation == '4') {	$free++;	}

   
}

$ges = $bcu + $ani + $free;
$prob = $bcu / $ges * 100;
$proba = $ani / $ges * 100;
$probr = $free / $ges * 100;
$prob = round($prob, 0);
$proba = round ($proba, 0);
$probr = round ($probr, 0);

echo "<font color=#FFFFF><u><b>Nazioni:</u></b></font>";
echo "<br>";
echo "<br>";
echo "<font color=#FF000>	BCU: $bcu piloti $prob %</font>";
echo "<br>";
echo "<font color=#00FF00>	ANI: $ani piloti $proba %</font>";
echo "<br>";
echo "<font color=#FF000>	FreeSKA: $free piloti $probr %</font>";
?>
			<h4>
			  <table >
				<form method="post" action="register_do.php">
				  <input type="hidden" name="step2" value="1" />
				  <tbody>
					<tr height="30">
					  <td width="189"><div align="center">
						<h4><font color='996600'>Nome </font></h4>
					  </div></td>
					  <td width="144"><div align="left">
						  <h5>
							<input name="username" type="text" value=""  tabindex="1" />
							  </h5>
					  </div></td>
					  <td width="410"><div align="left">
						<h5><font color='996600'> 6-15 caratteri.</font></h5>
					  </div></td>
					</tr>
					<tr>
					  <td height="30"><div align="center">
						<h4><font color='996600'>Mail </font></h4>
					  </div></td>
					  <td height="30"><div align="left">
						  <h5>
							<input name="mail1" type="text" value=""  tabindex="2" />
							  </h5>
					  </div></td>
					  <td height="30"><div align="left">
						<h5><font color='996600'> la tua mail.</font></h5>
					  </div></td>
					</tr>
					<tr>
					  <td height="30"><div align="center">
						<h4><font color='996600'>Password </font></h4>
					  </div></td>
					  <td height="30"><div align="left">
						  <h5>
							<input name="password1" type="password" value=""  tabindex="3" />
							  </h5>
					  </div></td>
					  <td height="30"><div align="left">
						<h5><font color='996600'> 6-15 caratteri.</font></h5>
					  </div></td>
					</tr>
					<tr>
					  <td height="30"><div align="center">
						<h4><font color='996600'>Ripeti password </font></h4>
					  </div></td>
					  <td height="30"><div align="left">
						  <h5>
							<input name="password2" type="password" value=""  tabindex="4" />
							  </h5>
					  </div></td>
					  <td height="30"><div align="left">
						<h5><font color='996600'> Ripeti la tua password.</font></h5>
					  </div></td>
					</tr>
					<tr>
					  <td> </td>
					  <td colspan="2"> </td>
					</tr>
					<tr>
					  <td colspan="3" height="10"><div align="center"><input name="submit" type="submit"  value="Registrati" /></div>         </td>
					</tr>
				  </tbody>
				</form>
			  </table>
			</h4>
			<CENTER>
				<h2>Scarica il gioco</h2><br>
				<a style="color: yellow; text-decoration: none;" href="#">Parte 1</a> / <a style="color: yellow; text-decoration: none;" href="#">Parte 2</a><br>
				<br>
				
			</CENTER>
		</div>

			
	</BODY>
</HTML>

This is homepage file and registration.
-----------------------------------------------------
register_do.php:
Code:
<?php

if(isset($_POST[step2])) {
    $errorStr = formStep3();
    if($errorStr!=null){
	#echo $errorStr;
	echo "<body style=\"background-color: black; color: white;\"><CENTER><h2>Spiacente!</h2><br><h3>Ci risulta che esiste gia un account o mail uguale a quello da te scelto! Cambia nome o mail nella registrazione account!</h3><br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a></CENTER></body>";
 #echo $errorStr;
    }else{
		echo "<body style=\"background-color: black; color: white;\"><CENTER><h2>Account ".$_POST[username]." registrato!</h2><br><h3>Ora puoi effettuare il Login sul tuo PC!</h3><br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a></CENTER></body>";
    }}
else {
    require_once('index.php');
    $_SESSION[step2] = 1;	}

function formStep3(){

include 'config.php';

//select a database to work with
$selected = mssql_select_db('atum2_db_account', $dbhandle)
  or die("Couldn't open database Account");
  
    //$errors = array();
    $errorStr = null;
	if(preg_match("/^[0-9a-zA-Z]{3,15}$/i", $_POST[username])){
	$strSql="select * from td_Account where AccountName='$_POST[username]'";
	$result = mssql_query($strSql);
    $ount = mssql_num_rows($result);
    if ($ount >0)  $errorStr = "Questo Username esiste gia sul nostro database, perfavore cambia l'username.<br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a>";
$strSqlmail="select * from td_Account where Email='$_POST[mail1]'";
	$result2 = mssql_query($strSqlmail);
    $ountmail = mssql_num_rows($result2);
    if ($ountmail >0)  $errorStr = "Questo indirizzo mail esiste gia sul nostro database, perfavore cambia email.<br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a>";

	}
if ($_POST[username] == "")	{	echo "<body style=\"background-color: black; color: white;\"><CENTER><br/><br/><br/><b>Attenzione:</b><br/>Non hai inserito il Nome account!<br/>Torna indietro e compila il campo Nome.<br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a></CENTER></body>"; exit; }
if ($_POST[password1] == "" OR $_POST[password1] != $_POST[password2] OR $_POST[password2] == "")	{	echo "<body style=\"background-color: black; color: white;\"><CENTER><br/><br/><br/><b>Attenzione:</b><br/>Perfavore verifica di nuovo i campi password.<br/>Qualcosa non ha funzionato correttamente!<br><a href='javascript:history.back()'><font color='green'><b>torna indietro</b></font></a></CENTER></body>"; exit; 

    }else{
	$userid= $_POST[username];
    $passwd_user=$_POST[password1];
	$mail_user=$_POST[mail1];
if ($errorStr==null){
$idaccount = mssql_query("SELECT MAX (AccountUniqueNumber) FROM atum2_db_account.dbo.td_Account");
            $ultimoid = mssql_fetch_row($idaccount);
            $NewID = $ultimoid[0] + 1; 
$regquery = "INSERT INTO td_Account (AccountUniqueNumber, AccountName, Password, Email) VALUES ('$NewID', '$userid', '$passwd_user', '$mail_user')";
	 //$dk_account_result1=odbc_do($regquery);
	 mssql_query($regquery);
     mssql_close($dbhandle);}
    }
    return $errorStr;
}
?>

Sorry, but is in italian lang because i'm italian....
In other day i update this by include sistem payment paypal
and statistic game top10 charapters...
Bye
:eek:tt1:
 
Last edited:

GTX

Newbie Spellweaver
Joined
Mar 25, 2012
Messages
65
Reaction score
1
in other day i update this by include sistem
 
Junior Spellweaver
Joined
Jan 5, 2012
Messages
121
Reaction score
44
Laura:

First Qestion:
what is this ?

Notice: Undefined variable: ani in //masterserv\weapllications\xampp\DS\web1\index.php on line 40
Notice: Undefined variable: free in //masterserv\weapllications\xampp\DS\web1\index.php on line 41
Notice: Undefined variable: bcu in //masterserv\weapllications\xampp\DS\web1\index.php on line 39

// application code is:

line 39 if ($nation == '1') { $bcu++; }
line 40 if ($nation == '2') { $ani++; }
line 41 if ($nation == '4') { $free++; }

// End Code

i dont understund it because next info is:

BCU: 972 piloti 46 %
ANI: 464 piloti 22 %
FreeSKA: 660 piloti 31 %

.... but why i got this warn ?
- its bad variable or not ?:)))

=================================

Second: its mssql_query :((

Do you tested it for weakness by SQL Injection ?

Imho PDO will be better:
 
Last edited:
Newbie Spellweaver
Joined
Feb 24, 2010
Messages
22
Reaction score
2
Papasmurf
This script is for ace ep 3.3 by connection database,
Your first question is for ANI player, BCU player and player not assign in This two Nation.
The error variable if because you not definite by php version...

include 'config.php';
$sql2 = "SELECT * FROM [atum2_db_1].[dbo].[td_Character]";
$ergebnis = mssql_query($sql2);
while($row = mssql_fetch_object($ergebnis))
{

##### Nation Translation ###
$nation = $row->InfluenceType;
if ($nation == '1') { $bcu++; }
if ($nation == '2') { $ani++; }
if ($nation == '4') { $free++; }


}
--------------------------------------
{ $bcu++; } count number player assign this nation
Piloti = Players in english

Remember: For sql_injection you need creation new variable and change character vulnerable in other character....The code i have in my website...if you want contact me in pvt ok?
Bye
 
Newbie Spellweaver
Joined
Feb 29, 2012
Messages
9
Reaction score
3
I keep getting call to undefined function mssql_connect() but all my extensions are working and my apahe is configured correctly
windows 7 32bit SQL 08 R2 datacenter edition.

errg this is annoying.
 
Newbie Spellweaver
Joined
Feb 29, 2012
Messages
9
Reaction score
3
Meh no need, i found that my hosting had sqlsrv disabled, so i just made a webserver and it's working just fine
with a few minor tweaks.
 
Back
Top