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!

[Development] Immortal web

Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
This is the site i'm currently working on, it's only a preview and will keep it simple for now, also i'll work it with the framework codeigniter.
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
can you share your account create html plz?

yeah, it will take some time, first need connect to the mssql database with php, thing i am trying now, it would be more easy without mssql.
 
Newbie Spellweaver
Joined
Sep 2, 2005
Messages
56
Reaction score
3
well i got this far with that code igniter has for db connector


$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = '192.168.1.2';
$db['default']['username'] = 'sa';
$db['default']['password'] = '123456';
$db['default']['database'] = 'PassportBOIOLD';
$db['default']['dbdriver'] = 'mssql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

idk if you need a controler for the query to work my php skils are low...

bdw how do i make the ID change evertime a user registers becouse that ID# does not work well
 
Joined
Jul 2, 2012
Messages
790
Reaction score
125
well i got this far with that code igniter has for db connector


$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = '192.168.1.2';
$db['default']['username'] = 'sa';
$db['default']['password'] = '123456';
$db['default']['database'] = 'PassportBOIOLD';
$db['default']['dbdriver'] = 'mssql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

idk if you need a controler for the query to work my php skils are low...

bdw how do i make the ID change evertime a user registers becouse that ID# does not work well

Check on How to make an account thread by Kev on BOI tutorial section, because OzzyGT just pose a very good one dunno if that will help but it does genarate different ID for accounts.
 
Newbie Spellweaver
Joined
Sep 2, 2005
Messages
56
Reaction score
3
heres a server status script

Server status configuration
*/
$config['STATUS']['LOGIN']['HOST'] = 'windows ip/gate save server';
$config['STATUS']['LOGIN']['PORT'] = gate save server port;
$config['STATUS']['GAME']['HOST'] = 'windows ip/server';
$config['STATUS']['GAME']['PORT'] = gamesave port;
$config['STATUS']['PANEL']['HOST'] = 'web host';
$config['STATUS']['PANEL']['PORT'] = web port /default is 80;
$config['STATUS']['FTP']['HOST'] = 'ftp ip';
$config['STATUS']['FTP']['PORT'] = ftp port/default is 21;

ok so i got to this point of the sql query.


$account = protect_this_input_variable($_POST['account']);
$password = md5($_POST['password']);

$query = "INSERT INTO account (id,creatime,name,passwd,usertype) Values('YOURID','YYYY.MM.DD','NAME',PASSWORD,'1')";

and maybe this works for password encription?

//Seeding
$config['PASSWORD']['HASH_SEED'] = 'Panelby%sNexux'; //%s will be replaced with the User's Password. Leave blank to deactivate
//Hashing
$config['PASSWORD']['HASH_METHOD'] = 'md5'; // md5 or sha1. Leave blank to deactivate
 
Last edited:
Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
It will be with 2 databases conections, one in mysql for the website(for login/edit password/admin post notices/and other stuff in future) and the other for mssql(for create new user/edit password). I started working with mysql first, because the server is in my friend house, tomorrow will try to open mssql ports so i can check if connects to the db. I hope can authenticate the mssql user, i chose a framework for security against like xss, csrf, sqli, etc.
But the most important here is that can connect and authenticate the mssql user(sa or other).
 

kev

Supreme Arcanarch
Loyal Member
Joined
May 12, 2003
Messages
904
Reaction score
52
dunno if this any help? maby change the mysql parts to mssql

these are .php files i changed to .txt to upload
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
This is from the perfect world game? maybe works...
 
Newbie Spellweaver
Joined
Sep 2, 2005
Messages
56
Reaction score
3
well to remote connect just open mysql bench and add account with your windows ip and add all privileges and your done
 
Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
This is so funny, mssql crash on my friend pc, i can see there is no services in SQL server configuration manager, is blank and can't start up services lol.
 
Junior Spellweaver
Joined
Mar 24, 2008
Messages
109
Reaction score
26
Ho men, mssql with php is so hard, can remember now why i gave up 3 years ago lol
The site it's almost done, but can't connect to mssql
 
Newbie Spellweaver
Joined
Aug 10, 2012
Messages
99
Reaction score
21
It's not that hard to connect to mssql from php.

To use mssql with php on linux first you have to install the driver, as root:

Code:
yum install php-mssql

and restart apache:

Code:
/etc/init.d/httpd restart

or

Code:
service httpd restart

If you are in windows, you have to uncomment the driver in php.ini. But if you're going to use apache on windows I think it would be better to use IIS with aspx.

The hard part comes when you have to insert the binary data (password) from php. I don't know, maybe if you try a query it would work but I usually use prepared statements for inserting data in the databases (safer).

I made a quick account registration page (html and php) as demostration of how to connect to mssql from php. It's more secure than the average registration page but I don't recommend using it in a production server.

Also, I had trouble sending the password as binary data from php, so I send it as a String and use the stored procedure "adduser" to convert the password to binary. So if you want to use this registration page you'll have to modify the sp:

Code:
USE [PassportBOIOLD]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROC [dbo].[adduser]
@name varchar(64),
@passwd varchar(32),
@prompt varchar(32),
@answer varchar(32),
@truename varchar(32),
@idnumber varchar(32),
@email varchar(64),
@mobilenumber varchar(32),
@province varchar(32),
@city varchar(32),
@phonenumber varchar(32),
@address varchar(64),
@postalcode varchar(8),
@gender integer,
@birthday varchar(32),
@qq varchar(32),
@passwd2 varchar(32)
AS
BEGIN

	BEGIN TRAN
	DECLARE @id integer
	DECLARE @now datetime
	SELECT @now = getdate()
	INSERT INTO account SELECT ISNULL(max(id), 16) + 16, @name, CONVERT(BINARY,@passwd,2), @now, 0 FROM account
	SELECT @id = id FROM account WHERE name = @name
	INSERT INTO users VALUES (@id, @prompt, @answer, @truename, @idnumber, @email, @mobilenumber, @province, @city, @phonenumber, @address, @postalcode, @gender, @birthday, @qq, CONVERT(BINARY,@passwd2,2))
	EXEC [dbo].[adduserpoint] @id, 9, 10
	COMMIT TRAN

END

Just copy the text in a new query window (SQL Server Management Studio) and press execute.

Using this, the sp will create the rows for the account, user and point tables, also I saw someone asking about the auto-increment for the ids, using this stored procedure you'll get that, but for some reason, the original developers make the autoincrement by 16. So the ids are going to be 16,32,64,80... and I guess is for a reason so I'm not going to change that.

If you can connect from Linux to MSSQL, this registration page should work. Just need to change the IP of the mssql server in the php and the URL in the form of the HTML.

Hope it helps someone or at least you can use the connection part to learn how to use mssql from php.
 

Attachments

You must be registered for see attachments list
Last edited:
Back
Top