|
You last visited: Today at 03:32
Advertisement
How to set up a site where people can register?
Discussion on How to set up a site where people can register? within the Zero forum part of the MMORPGs category.
09/15/2009, 20:25
|
#1
|
elite*gold: 0
Join Date: Aug 2009
Posts: 6
Received Thanks: 0
|
How to set up a site where people can register?
Well, I finally got the server working, but now how to get the register working, I downloaded the register files from the sticky thread but no idea how to get it set up right.
I don't exactly know all the info it's asking for in the register.php and the config.php
If someone could tell me or put it into more detail of what goes where then I could get past this problem.
Config.php
Code:
<?php
// Configurations
$myhost="65.75.250.41";
$mypass="binhazad"; //your server login password
$myuser="necron"; //your server login username
$mydbacc="account"; //your server account database
$mydbdata="MY"; //your server my database name
$serveraddress="65.75.250.41"; //your server ip
$accport=9958; //your ACC connection port
$msgport=5816; //your MSG connection port
$npcport=9958; //your MSG connection port
$servername="Alpha-0nline"; //your server name
$mydb="MY"; //your server my database
$forum="127.0.0.1";
$mydb = "MY"; //your server my database
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
Register.php
Code:
<?
$myhost="65.75.250.41";
$mypass="binhazad"; //your server login password
$myuser="necron"; //your server login username
$mydbacc="account"; //your server account database
$mydbdata="MY"; //your server my database name
$serverport=3306; //your server connection port
$mydb="MY"; //your server my database
$servername="Alpha-Online";
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Server Register</title>
<script type="text/javascript" src="./inc/md5.js"></script>
</head>
<DIV align="center"><b class="h2"><font color="white">
<?php
echo "Welcome to ".$servername." Account Registration";
?>
</b>
<br />
<br />
<form method='post' action='register.php'>
<TABLE width="312">
<TBODY>
<TR>
<TD id=GoodStuff style="PADDING-LEFT: 0px; MARGIN-LEFT: 0px">
<DIV id=theform style="PADDING-LEFT: 0px">
<TABLE class=body width="323" height="229">
<TBODY>
<TR>
<TD align="left" height="32"><font color="white">UserID:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name="id" id="id"> </TR>
<TR>
<TD align="left" height="37"><font color="white">Password:</TD>
<TD class=it3 height="37">
<INPUT class=it id="ipassword" style="FONT-SIZE: 9pt" type=password maxLength=12 name=pass></TD>
</TR>
<TR>
<TD align="left" height="32"><font color="white">Retype Password:</TD>
<TD class=it3 height="32">
<input class=it1 id="ipassword" style="FONT-SIZE: 9pt" type=password maxlength=12 name=retpass></TD>
</TR>
<TD align="left" height="32"><font color="white">Email:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name=email>
<TR>
<TD></TD>
<TD style="FONT-SIZE: 14px; VERTICAL-ALIGN: middle">
<span style="font-size: 9pt"><input type="hidden" name="hash"><input class=Butt type=submit onclick="hash.value = login(pass.value)" value='Register' name=B1></span></TD>
</TR></TBODY></TABLE>
</DIV></TD></TR></TBODY></TABLE></FORM>
<center>
<?php
if($_POST['B1'])
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
$email=trim($_POST['email']);
if($password != $passretype) {
echo "Password not equal to Retyped Password.";
}else{
if(!ereg("^[0-9a-zA-Z]{4,12}$",$password))
{
echo "Only letters or numbers, length of 4 to 12 characters";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
mysql_query("insert into account (name,Password,Reg_date,email) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."','".$email."')");
echo "Account registered successfully.";
}
else
{
echo "Account Already exists in database.";
}
}
}
}
?>
</center>
</DIV>
</body>
</html>
|
|
|
09/16/2009, 06:26
|
#2
|
elite*gold: 0
Join Date: May 2008
Posts: 688
Received Thanks: 379
|
Should Look like this
Config.php
Code:
<?php
// Configurations
$myhost="65.75.250.41";
$mypass="binhazad"; //your server login password
$myuser="necron"; //your server login username
$mydbacc="jz_acc"; //your server account database
$mydbdata="jz"; //your server my database name
$serveraddress="65.75.250.41"; //your server ip
$accport=9958; //your ACC connection port
$msgport=5816; //your MSG connection port
$npcport=9958; //your MSG connection port
$servername="Alpha-0nline"; //your server name
$mydb="MY"; //your server my database
$forum="127.0.0.1";
$mydb = "MY"; //your server my database
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
Should Look like this
Register.php
Code:
<?
$myhost="65.75.250.41";
$mypass="binhazad"; //your server login password
$myuser="necron"; //your server login username
$mydbacc="jz-acc"; //your server account database
$mydbdata="jz"; //your server my database name
$serverport=3306; //your server connection port
$mydb="MY"; //your server my database
$servername="Alpha-Online";
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Server Register</title>
<script type="text/javascript" src="./inc/md5.js"></script>
</head>
<DIV align="center"><b class="h2"><font color="white">
<?php
echo "Welcome to ".$servername." Account Registration";
?>
</b>
<br />
<br />
<form method='post' action='register.php'>
<TABLE width="312">
<TBODY>
<TR>
<TD id=GoodStuff style="PADDING-LEFT: 0px; MARGIN-LEFT: 0px">
<DIV id=theform style="PADDING-LEFT: 0px">
<TABLE class=body width="323" height="229">
<TBODY>
<TR>
<TD align="left" height="32"><font color="white">UserID:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name="id" id="id"> </TR>
<TR>
<TD align="left" height="37"><font color="white">Password:</TD>
<TD class=it3 height="37">
<INPUT class=it id="ipassword" style="FONT-SIZE: 9pt" type=password maxLength=12 name=pass></TD>
</TR>
<TR>
<TD align="left" height="32"><font color="white">Retype Password:</TD>
<TD class=it3 height="32">
<input class=it1 id="ipassword" style="FONT-SIZE: 9pt" type=password maxlength=12 name=retpass></TD>
</TR>
<TD align="left" height="32"><font color="white">Email:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name=email>
<TR>
<TD></TD>
<TD style="FONT-SIZE: 14px; VERTICAL-ALIGN: middle">
<span style="font-size: 9pt"><input type="hidden" name="hash"><input class=Butt type=submit onclick="hash.value = login(pass.value)" value='Register' name=B1></span></TD>
</TR></TBODY></TABLE>
</DIV></TD></TR></TBODY></TABLE></FORM>
<center>
<?php
if($_POST['B1'])
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
$email=trim($_POST['email']);
if($password != $passretype) {
echo "Password not equal to Retyped Password.";
}else{
if(!ereg("^[0-9a-zA-Z]{4,12}$",$password))
{
echo "Only letters or numbers, length of 4 to 12 characters";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
mysql_query("insert into account (name,Password,Reg_date,email) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."','".$email."')");
echo "Account registered successfully.";
}
else
{
echo "Account Already exists in database.";
}
}
}
}
?>
</center>
</DIV>
</body>
</html>
|
|
|
09/16/2009, 13:39
|
#3
|
elite*gold: 0
Join Date: Aug 2009
Posts: 6
Received Thanks: 0
|
Thanks, but the problem is still there, I don't see the account in the database.
Heres the setup of the files. (The *** are parts I have choosen to hide.)
Code:
<?php
// Configurations
$myhost="192.168.1.3";
$mypass="***"; //your server login password
$myuser="***"; //your server login username
$mydbacc="jz_acc"; //your server account database
$mydbdata="jz"; //your server my database name
$serveraddress="192.168.1.3"; //your server ip
$accport=9958; //your ACC connection port
$msgport=5816; //your MSG connection port
$npcport=9958; //your MSG connection port
$servername="Zero"; //your server name
$mydb="jz"; //your server my database
$forum="***";
$mydb = "jz"; //your server my database
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
Code:
<?
$myhost="192.168.1.3";
$mypass="***"; //your server login password
$myuser="***"; //your server login username
$mydbacc="jz_acc"; //your server account database
$mydbdata="jz"; //your server my database name
$serverport=3306; //your server connection port
$mydb="jz"; //your server my database
$servername="Zero";
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Server Register</title>
<script type="text/javascript" src="./inc/md5.js"></script>
</head>
<DIV align="center"><b class="h2"><font color="white">
<?php
echo "Welcome to ".$servername." Account Registration";
?>
</b>
<br />
<br />
<form method='post' action='register.php'>
<TABLE width="312">
<TBODY>
<TR>
<TD id=GoodStuff style="PADDING-LEFT: 0px; MARGIN-LEFT: 0px">
<DIV id=theform style="PADDING-LEFT: 0px">
<TABLE class=body width="323" height="229">
<TBODY>
<TR>
<TD align="left" height="32"><font color="black">UserID:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name="id" id="id"> </TR>
<TR>
<TD align="left" height="37"><font color="black">Password:</TD>
<TD class=it3 height="37">
<INPUT class=it id="ipassword" style="FONT-SIZE: 9pt" type=password maxLength=12 name=pass></TD>
</TR>
<TR>
<TD align="left" height="32"><font color="black">Retype Password:</TD>
<TD class=it3 height="32">
<input class=it1 id="ipassword" style="FONT-SIZE: 9pt" type=password maxlength=12 name=retpass></TD>
</TR>
<TD align="left" height="32"><font color="black">Email:</TD>
<TD class=it3 height="32">
<INPUT class=it style="FONT-SIZE: 9pt" name=email>
<TR>
<TD></TD>
<TD style="FONT-SIZE: 14px; VERTICAL-ALIGN: middle">
<span style="font-size: 9pt"><input type="hidden" name="hash"><input class=Butt type=submit onclick="hash.value = login(pass.value)" value='Register' name=B1></span></TD>
</TR></TBODY></TABLE>
</DIV></TD></TR></TBODY></TABLE></FORM>
<center>
<?php
if($_POST['B1'])
{
mysql_select_db($mydbacc);
$userid = trim($_POST['id']);
$password=trim($_POST['pass']);
$passretype=trim($_POST['retpass']);
$hash=$_POST['hash'];
$email=trim($_POST['email']);
if($password != $passretype) {
echo "Password not equal to Retyped Password.";
}else{
if(!ereg("^[0-9a-zA-Z]{4,12}$",$password))
{
echo "Only letters or numbers, length of 4 to 12 characters";
}
else
{
$res = mysql_query("select * from account where name = '".$userid."' order by id desc");
if(mysql_num_rows($res) == 0)
{
mysql_query("insert into account (name,Password,Reg_date,email) values ('".$userid."','".$hash."','".date("y-m-d H:i:s", time())."','".$email."')");
echo "Account registered successfully.";
}
else
{
echo "Account Already exists in database.";
}
}
}
}
?>
</center>
</DIV>
</body>
</html>
|
|
|
09/17/2009, 00:22
|
#4
|
elite*gold: 0
Join Date: May 2008
Posts: 688
Received Thanks: 379
|
are you usein jz_acc or account ? if jz_acc did you give it permission in Navicat ? same for account and if you are not useing jz_acc you need to change it in the config of both files....
|
|
|
09/17/2009, 10:35
|
#5
|
elite*gold: 0
Join Date: Aug 2009
Posts: 6
Received Thanks: 0
|
Quote:
Originally Posted by mama020153
are you usein jz_acc or account ? if jz_acc did you give it permission in Navicat ? same for account and if you are not useing jz_acc you need to change it in the config of both files....
|
Yes I am using jz_acc and I did give it permissions.
As you can see I in the picture I gave the account permissions, I gave them permissions to do everything.
|
|
|
09/17/2009, 20:28
|
#6
|
elite*gold: 0
Join Date: May 2008
Posts: 688
Received Thanks: 379
|
then it should work and the ip should be 127.0.0.1 not your ip try that...
|
|
|
09/18/2009, 05:37
|
#7
|
elite*gold: 0
Join Date: Aug 2009
Posts: 6
Received Thanks: 0
|
Ok thanks it works now, it actually is adding the accounts to the database now, but now I'm getting a error when I try and login with the made account.
The error is; "Unable to connection game server. Please try again later".
|
|
|
10/28/2009, 21:26
|
#8
|
elite*gold: 0
Join Date: Dec 2008
Posts: 107
Received Thanks: 1
|
thx guys 4 the big help hope we see moor
|
|
|
|
Similar Threads
|
[PHP]Register Site
09/05/2010 - Flyff Private Server - 10 Replies
Das Alter kann nicht ausgelesen werden, hoffe ihr könnt mir helfen.
Ich habe die Problemstelle Rot makiert.
Bitte nicht von Gear Typ und weiteres verwirren lassen.
<----register.php---->
<?php require("config.php") ?>
<center><form action="?page=register" method="post">
<table border="0">
|
How to make people register my server from site
12/28/2009 - EO PServer Hosting - 4 Replies
How to make people register my server from site ?
:handsdown::handsdown::handsdown::handsdown::hand sdown::handsdown:
plesasa someOne post how can i do it , because ineed to upload it
|
[HELP]How to get register on site >.<
09/23/2009 - CO2 Private Server - 7 Replies
#Request Close
|
help pls register site
03/27/2009 - CO2 Private Server - 9 Replies
why i can join on register site and another people can't?pls help my server is on hamachi....
|
help register site
03/23/2009 - Conquer Online 2 - 0 Replies
why i can join on register site and another people can't?pls help my server is on hamachi...
|
All times are GMT +2. The time now is 03:32.
|
|