GamersTambayan Forum For All Gamers! |
|
| Flyff v15 Register Script | |
| | Author | Message |
---|
-яaкi- GamersAdmin
Posts : 16 Join date : 2010-07-03
| Subject: Flyff v15 Register Script Sat Jul 03, 2010 10:56 pm | |
| i've noticed many people had problem creating accounts so i released this script which i edited to make it work in v15. - Spoiler:
First execute this query by Reimniess to creat createaccount procedure
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[createaccount] @account VARCHAR(15), @password VARCHAR(32)
AS
SET NOCOUNT ON
DECLARE @DateActivated AS CHAR(8)
IF NOT EXISTS (SELECT account FROM ACCOUNT_TBL WHERE account = @account) BEGIN INSERT INTO ACCOUNT_TBL (account, [password], id_no2, isuse, member, realname) VALUES (@account, @password, @password, 'T', 'A', 'F')
SET @DateActivated = CONVERT(CHAR(8), GETDATE()-1, 112 ) --Is the date today - 1 --UPDATE ACCOUNT_TBL_DETAIL SET BlockTime = @DateYesterday WHERE account = @userid --INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse) -- VALUES (@account, 'A000', '2', 'F', GETDATE(), '20990101', '20990101', '20050101', 'O')
INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse) VALUES (@account, 'A000', '2', 'F', GETDATE(), @DateActivated, '20990101', '20050101', 'O')
END
And then save this page as w/e u like i prefer register.php - Spoiler:
<?php $link = @mssql_connect("\SQLEXPRESS", "user", "pass") or die ("Server is down!"); $db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!"); $b = ''; $mail = ''; function doesUsernameExist($name){ $exit = FALSE; $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'"); if (mssql_num_rows($result) != 0){ $exit = TRUE; } return $exit; }
if(isset($_POST['submit'])){ $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']); $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']); if($_POST['username'] == ""){ echo '<font color="red">Enter a user.</font><br /><br />'; } else if($_POST['password'] == ""){ echo '<font color="red">Enter a password.</font><br /><br />'; } else if ((strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){ echo '<font color="red">The user should be 3 to 16 characters.</font><br /><br />'; } else if ((strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){ echo '<font color="red">The password should be 3 to 16 characters.</font><br /><br />'; } else if($_POST['username'] != $user){ echo '<font color="red">User with invalid characters.</font><br /><br />'; } else if($_POST['password'] != $pass){ echo '<font color="red">Password with invalid characters.</font><br /><br />'; } else { $pass = md5('serus' . $pass); if(!doesUsernameExist($user)){ $stmt = mssql_init('createaccount', $link); mssql_bind($stmt, '@account', $user, SQLVARCHAR, false, false, 15); mssql_bind($stmt, '@password', $pass, SQLVARCHAR, false, false, 36);
mssql_execute($stmt) or die ("Something is wrong on the execution"); mssql_free_statement($stmt); echo '<font color="Green">Register Successfull.</font><br /><br />'; } else { echo '<font color="red">User already Exist.</font><br /><br />'; } } mssql_close(); }
echo '<form action="#" method="post">'; echo 'Username: <input type="text" name="username" /><br /><br />'; echo 'Password: <input type="password" name="password" /><br /><br />';
echo '<br /><input type="submit" name="submit" value="Register" />'; echo '</form>';
?>
If You Do Not Want to use script here is query to make account now u still need to create procedure creataccount and then execute this : - Spoiler:
USE [ACCOUNT_DBF] GO
DECLARE @return_value int
EXEC @return_value = [dbo].[createaccount] @account = N'user', @password = N'pass in md5(serus+pass)'
SELECT 'Return Value' = @return_value
GO
| |
| | | mIGhty047 iLOVEForum
Posts : 1 Join date : 2012-04-07
| Subject: Re: Flyff v15 Register Script Sat Apr 07, 2012 4:50 pm | |
| - -яaкi- wrote:
- i've noticed many people had problem creating accounts so i released this script which i edited to make it work in v15.
- Spoiler:
First execute this query by Reimniess to creat createaccount procedure
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[createaccount] @account VARCHAR(15), @password VARCHAR(32)
AS
SET NOCOUNT ON
DECLARE @DateActivated AS CHAR(8)
IF NOT EXISTS (SELECT account FROM ACCOUNT_TBL WHERE account = @account) BEGIN INSERT INTO ACCOUNT_TBL (account, [password], id_no2, isuse, member, realname) VALUES (@account, @password, @password, 'T', 'A', 'F')
SET @DateActivated = CONVERT(CHAR(8), GETDATE()-1, 112 ) --Is the date today - 1 --UPDATE ACCOUNT_TBL_DETAIL SET BlockTime = @DateYesterday WHERE account = @userid --INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse) -- VALUES (@account, 'A000', '2', 'F', GETDATE(), '20990101', '20990101', '20050101', 'O')
INSERT INTO ACCOUNT_TBL_DETAIL (account, gamecode, tester, m_chLoginAuthority, regdate, BlockTime, EndTime, WebTime, isuse) VALUES (@account, 'A000', '2', 'F', GETDATE(), @DateActivated, '20990101', '20050101', 'O')
END
And then save this page as w/e u like i prefer register.php
- Spoiler:
<?php $link = @mssql_connect("\SQLEXPRESS", "user", "pass") or die ("Server is down!"); $db = @mssql_select_db('ACCOUNT_DBF') or die ("Accout table is missing!"); $b = ''; $mail = ''; function doesUsernameExist($name){ $exit = FALSE; $result = @mssql_query("SELECT * FROM ACCOUNT_TBL WHERE account='$name'"); if (mssql_num_rows($result) != 0){ $exit = TRUE; } return $exit; }
if(isset($_POST['submit'])){ $user = preg_replace ("[^A-Za-z0-9]", "", $_POST['username']); $pass = preg_replace ("[^A-Za-z0-9]", "", $_POST['password']); if($_POST['username'] == ""){ echo '<font color="red">Enter a user.</font><br /><br />'; } else if($_POST['password'] == ""){ echo '<font color="red">Enter a password.</font><br /><br />'; } else if ((strlen($_POST['username']) > 16) || (strlen($_POST['username']) < 3)){ echo '<font color="red">The user should be 3 to 16 characters.</font><br /><br />'; } else if ((strlen($_POST['password']) > 16) || (strlen($_POST['password']) < 3)){ echo '<font color="red">The password should be 3 to 16 characters.</font><br /><br />'; } else if($_POST['username'] != $user){ echo '<font color="red">User with invalid characters.</font><br /><br />'; } else if($_POST['password'] != $pass){ echo '<font color="red">Password with invalid characters.</font><br /><br />'; } else { $pass = md5('serus' . $pass); if(!doesUsernameExist($user)){ $stmt = mssql_init('createaccount', $link); mssql_bind($stmt, '@account', $user, SQLVARCHAR, false, false, 15); mssql_bind($stmt, '@password', $pass, SQLVARCHAR, false, false, 36);
mssql_execute($stmt) or die ("Something is wrong on the execution"); mssql_free_statement($stmt); echo '<font color="Green">Register Successfull.</font><br /><br />'; } else { echo '<font color="red">User already Exist.</font><br /><br />'; } } mssql_close(); }
echo '<form action="#" method="post">'; echo 'Username: <input type="text" name="username" /><br /><br />'; echo 'Password: <input type="password" name="password" /><br /><br />';
echo '<br /><input type="submit" name="submit" value="Register" />'; echo '</form>';
?>
If You Do Not Want to use script here is query to make account now u still need to create procedure creataccount and then execute this :
- Spoiler:
USE [ACCOUNT_DBF] GO
DECLARE @return_value int
EXEC @return_value = [dbo].[createaccount] @account = N'user', @password = N'pass in md5(serus+pass)'
SELECT 'Return Value' = @return_value
GO
Hi.. Raki. How Can I put this on my Website -Sorry Im Noob on site. PLEASE | |
| | | | Flyff v15 Register Script | |
|
Similar topics | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |
|