|
You last visited: Today at 03:47
Advertisement
Register Problem
Discussion on Register Problem within the Shaiya PServer Development forum part of the Shaiya Private Server category.
06/12/2016, 21:21
|
#1
|
elite*gold: 0
Join Date: Mar 2014
Posts: 14
Received Thanks: 2
|
Register Problem
i Have this problem with register:
im using the abrasive script
|
|
|
06/12/2016, 21:36
|
#2
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 360
|
For slq
Code:
USE [PS_UserData]
GO
/****** Object: Table [dbo].[Users_Master] Script Date: 12.06.2016 21:33:33 ******/
DROP TABLE [dbo].[Users_Master]
GO
/****** Object: Table [dbo].[Users_Master] Script Date: 12.06.2016 21:33:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Users_Master](
[UserUID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [varchar](18) NOT NULL,
[Pw] [varchar](12) NOT NULL,
[JoinDate] [smalldatetime] NULL CONSTRAINT [DF_Users_Master_JoinDate] DEFAULT (getdate()),
[Admin] [bit] NULL,
[AdminLevel] [tinyint] NULL,
[UseQueue] [bit] NULL,
[Status] [smallint] NULL,
[Leave] [tinyint] NULL,
[LeaveDate] [smalldatetime] NULL,
[UserType] [char](1) NULL,
[UserIp] [varchar](15) NULL,
[ModiIp] [varchar](15) NULL,
[ModiDate] [datetime] NULL,
[Point] [int] NULL CONSTRAINT [DF_Users_Master_Point] DEFAULT ((0)),
[Enpassword] [char](32) NULL,
[Birth] [varchar](8) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
for php
Code:
<?php
require_once('recaptchalib.config.php');
require_once('recaptchalib.php');
require_once('db.config.php');
$user_ip = $_SERVER['REMOTE_ADDR'];
$username = isset($_POST['username']) ? mssql_escape_string(trim($_POST['username'])) : '';
$password = isset($_POST['password']) ? mssql_escape_string(trim($_POST['password'])) : '';
$password2 = isset($_POST['password2']) ? mssql_escape_string(trim($_POST['password2'])) : '';
$errors = array();
$success = false;
if(isset($_POST) && !empty($_POST)){
require_once('db.php');
// Validate user name.
$result = [MENTION=311501]ODB[/MENTION]c_exec($conn,"SELECT UserID FROM PS_UserData.dbo.Users_Master WHERE UserID = '{$username}'") or die('Failed to verify is the provided user named already exists.');
if(empty($username)){
$errors[] = 'Please provide a user name.';
}else if(strlen($username) < 3 || strlen($username) > 16){
$errors[] = 'User name must be between 3 and 16 characters in length.';
}else if(ctype_alnum($username) === false){
$errors[] = 'User name must consist of numbers and letters only.';
}else if(odbc_num_rows($result)){
$errors[] = 'User name already exists, please choose a different user name.';
}
// Validate user password.
if(empty($password)){
$errors[] = 'Please provide a password.';
}else if(strlen($password) < 3 || strlen($password) > 16){
$errors[] = 'Password must be between 3 and 16 characters in length.';
}else if($password != $password2){
$errors[] = 'Passwords do not match.';
}
// Validate reCAPTCHA. This is to prevent someone botting account creation.
$response = recaptcha_check_answer($recaptcha_private_key,$_SERVER['REMOTE_ADDR'],$_POST['recaptcha_challenge_field'],$_POST['recaptcha_response_field']);
if(!$response->is_valid){
if($response->error == 'incorrect-captcha-sol'){
$errors['recaptcha'] = 'Incorrect answer to reCAPTCHA';
}else{
$errors['recaptcha'] = $response->error;
}
}
// Persist the new account to the database if no previous errors occured.
if(count($errors) == 0){
$sql = "INSERT INTO PS_UserData.dbo.Users_Master
(UserID,Pw,JoinDate,Admin,AdminLevel,UseQueue,Status,Leave,LeaveDate,UserType,Point,EnPassword,UserIp)
VALUES ('{$username}','{$password}',GETDATE(),0,0,0,0,0,GETDATE(),'N',0,'','{$user_ip}')";
// Remove the @ symbol here to see what the SQL error message is when running the above query in $sql.
if($result = [MENTION=311501]ODB[/MENTION]c_exec($conn,$sql)){
$success = "Account {$username} successfully created!";
}else{
// This means the insert statement is probably not valid for your database. Fix the query or fix your database, your choice ;)
$errors[] = 'Failed to create a new account, please try again later';
}
}
}
// Determine which view to show.
if($success === false){
require_once('register.view.php');
}else{
require_once('success.view.php');
}
?>
|
|
|
06/15/2016, 16:34
|
#3
|
elite*gold: 0
Join Date: Jun 2011
Posts: 19
Received Thanks: 2
|
fixed register
USE [PS_UserData]
GO
/****** Object: Table [dbo].[Users_Master] Script Date: 12.06.2016 21:33:33 ******/
DROP TABLE [dbo].[Users_Master]
GO
/****** Object: Table [dbo].[Users_Master] Script Date: 12.06.2016 21:33:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Users_Master](
[UserUID] [int] NULL,
[UserID] IDENTITY(1,1) NOT NULL,
[Pw] [varchar](12) NOT NULL,
[JoinDate] [smalldatetime] NULL CONSTRAINT [DF_Users_Master_JoinDate] DEFAULT (getdate()),
[Admin] [bit] NULL,
[AdminLevel] [tinyint] NULL,
[UseQueue] [bit] NULL,
[Status] [smallint] NULL,
[Leave] [tinyint] NULL,
[LeaveDate] [smalldatetime] NULL,
[UserType] [char](1) NULL,
[UserIp] [varchar](15) NULL,
[ModiIp] [varchar](15) NULL,
[ModiDate] [datetime] NULL,
[Point] [int] NULL CONSTRAINT [DF_Users_Master_Point] DEFAULT ((0)),
[Enpassword] [char](32) NULL,
[Birth] [varchar](8) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
|
|
|
06/17/2016, 14:37
|
#4
|
elite*gold: 83
Join Date: May 2011
Posts: 11,029
Received Thanks: 6,036
|
Shaiya Private Server -> Shaiya PServer De…
#moved…
|
|
|
 |
Similar Threads
|
Register Problem
12/23/2012 - CO2 Private Server - 6 Replies
Okay so if i register for my server on my site it says invalid account id or password. but if i register with /newacc it works just fine. im using a 5165 source and iv tryed 3 different register pages now.
|
Register[Problem]
05/19/2011 - Flyff Private Server - 14 Replies
#
|
Register-Problem
02/20/2011 - Flyff Private Server - 12 Replies
Hey alle zusammen,
Ich wollte fragen ob ihr mir helfen könnt habe ein kleines problem habe meine registe page eingestellt aber da kommt ein EROR hier mal der Eror :
Notice: Undefined index: s in C:\xampp\htdocs\register.php on line 208
Ich würde mich freuen wen ihr mir helfen könnt :D:D:
|
Register Problem
11/01/2009 - Metin2 Private Server - 12 Replies
Meine Regi geht nicht mehr alles ist an alles läuft super dann kommt das
Warning: mysql_real_escape_string() : Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\reg.php on line 7
Warning: mysql_real_escape_string() : A link to the server could not be established in C:\xampp\htdocs\reg.php on line 7
Warning: mysql_real_escape_string() : Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\reg.php on line 8
Warning:...
|
PROBLEM ON THE REGISTER
07/25/2009 - SRO Private Server - 2 Replies
The credential number must be bigger than 6, be smaller than 20! Please fill in
wth I need to do ther
|
All times are GMT +1. The time now is 03:47.
|
|