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!

[Web/PHP] Basic Register Script

Joined
Jul 18, 2009
Messages
391
Reaction score
129
I am releasing a very basic register script.
I don't know much PHP myself and built this script by using Google search, so my apologies if it has a messy code.

I hope that people that do not know much about PHP, like myself, will use this to see how it operates and learn from it.

Enjoy!

PS: As you might notice, this file calls for a ban.php

which is a php file that looks like this:

Code:
<?php 
$ip = $_SERVER['REMOTE_ADDR'];
$banned = array("xxx.xxx.xxx.xxx","xxx.xxx.xxx.xxx","xxx.xxx.xxx.xxx"); 
if (in_array("$ip", $banned))  {
die("You have been banned from this site"); 
}
else
{
}
?>
 

Attachments

You must be registered for see attachments list
Last edited:
Creator of Code
Joined
Mar 5, 2006
Messages
371
Reaction score
131
Re: [Release] Basic Register Script

Doesnt the gameserver store IP when banning someone? Wouldnt it be better to check that list instead of having two lists?
 
Creator of Code
Joined
Mar 5, 2006
Messages
371
Reaction score
131
Re: [Release] Basic Register Script

It does only check if an ip is banned. The Else is empty.


---------- Post added at 08:09 AM ---------- Previous post was at 08:07 AM ----------

Didnt read properly and missed the register file. Try turning on error logging.
 
Junior Spellweaver
Joined
Feb 8, 2011
Messages
101
Reaction score
1
Re: [Release] Basic Register Script

Ok, i tested this on a different computer where the db connection was working properly.

There is something missing there.

After the Submit the page just get blank, and nothing changes in the database.

Are you sure there are no other files needed?

(My noobprotection is at 0 tho, dunno if that would be it? 1 shows an 'error' message)
 
Joined
Jul 18, 2009
Messages
391
Reaction score
129
Re: [Release] Basic Register Script

The only thing regarding registrations that I altered is the register procedure, which is the one I released earlier.
I'm not sure if I edited any of the parameters in there though.

Here's my currently altered messy procedure.
Although I don't expect that's the problem.
Code:
USE [ini3_py_account]
GO
/****** Object:  StoredProcedure [dbo].[SP_PANGYA_REGIST]    Script Date: 03/19/2011 12:33:36 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[SP_PANGYA_REGIST]

@idcard	CHAR(13),
@sex 		BIT,
@birthday 	VARCHAR(50),
@zipcode	CHAR(5),
@id		VARCHAR(32),
@pswd		VARCHAR(32)

AS

IF NOT EXISTS(	SELECT UserID FROM Ini3_UserLogin WHERE UserID = @id AND VisaIDCard = @idcard)
       BEGIN
	INSERT INTO Ini3_UserLogin(UserID, Password, Birthday, Sex, VisaIDCard, Confirm18, UserName, ZipCode)
	VALUES (@id, @pswd, CONVERT(DATETIME,@birthday), @sex, @idcard, '0', @id, @zipcode)
	
	
	DECLARE @UserName varchar(32)
	DECLARE @UserIdx int
	
		-- Static sitecode, is always 'ini3'
	DECLARE @siteCode varchar(5)
	SET @siteCode = N'ini3'

	-- Get the nickname and the idx for the specified user from the game-server database...
	SELECT @UserName = [UserID], @UserIdx = [idx] FROM [ini3_py_account].[dbo].[Ini3_UserLogin]
	WHERE userid = @id;
	
	-- Check whether we have previous records for this user...
	SELECT UserNo, UserID FROM [INI3BILL_DB].[dbo].TAccountMst
	WHERE UserNo = @UserIdx
	AND UserID = @id
	
	IF @@ROWCOUNT = 0
		-- User never got cookies so we need to create a new row for him...
		INSERT INTO [INI3BILL_DB].[dbo].TAccountMst ([SiteCode], [UserNo], [UserID], [UserName], [CookieAmt])
		VALUES ( @siteCode, @UserIdx, @id, @UserName, '250000')
	ELSE
		-- User has cookies so we can simply update the old value
		UPDATE [INI3BILL_DB].[dbo].TAccountMst SET [CookieAmt] = [CookieAmt] + '250000', [UpdDate] = CURRENT_TIMESTAMP
		WHERE [UserNo] = @UserIdx AND [UserID] = @id
       END

Btw, the noobprotection variable is something I added to make sure whoever uses it knows at least a little bit about how php scripts work.
 
Newbie Spellweaver
Joined
Jun 17, 2010
Messages
69
Reaction score
7
Re: [Release] Basic Register Script

after completing all and click the register page is all white, nothing happens.
 
Junior Spellweaver
Joined
Feb 8, 2011
Messages
101
Reaction score
1
Re: [Release] Basic Register Script

Yep, not working, still get just a blank page with nothing inserted on DB.
 
Newbie Spellweaver
Joined
Jun 17, 2010
Messages
69
Reaction score
7
Re: [Release] Basic Register Script

me too have this problem

EDIT :

now I have another problem: Fatal error: Call to undefined function checkdnsrr () in C: \ wamp \ www \ register.php on line 19

Anyone know how to solve?
 
Last edited:
Newbie Spellweaver
Joined
Mar 15, 2011
Messages
21
Reaction score
1
Re: [Release] Basic Register Script

me too have this problem

EDIT :

now I have another problem: Fatal error: Call to undefined function checkdnsrr () in C: \ wamp \ www \ register.php on line 19

Anyone know how to solve?


I think it is about checkdnsrr
 
Newbie Spellweaver
Joined
Feb 12, 2011
Messages
21
Reaction score
1
Re: [Release] Basic Register Script

I'm fix my problem and add future check user

Download Now...
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Feb 3, 2008
Messages
8
Reaction score
0
Re: [Release] Basic Register Script

Yep, not working, still get just a blank page with nothing inserted on DB.


Use xampp 1.6.8
This will fix the blank page .
 
Newbie Spellweaver
Joined
May 7, 2011
Messages
10
Reaction score
0
This keeps giving me a white page with nothing inserted into database. :/
 
Newbie Spellweaver
Joined
Dec 16, 2016
Messages
20
Reaction score
1
I have the same problem with xampp that the page remains white there is since a solution in the database happens also nothing?
this is my site
 
Last edited:
Newbie Spellweaver
Joined
Feb 8, 2012
Messages
12
Reaction score
0
I have the same problem with xampp that the page remains white there is since a solution in the database happens also nothing?
this is my site

dunno whats your problem, but it works

X_Sarah_X - [Web/PHP] Basic Register Script - RaGEZONE Forums


Edit: Nevermind, saw your other post about it that you have fixed it. :D
 
Initiate Mage
Joined
Jul 11, 2015
Messages
3
Reaction score
0
esse janela, serve para cadastro no serve s4 Ou no serve s8? / Google Tradutor : This window, serve to register does not serve s4 Or not serve s8?
 
Back
Top