1 Attachment(s)
[Web/PHP] Basic Register Script
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
{
}
?>
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?
Re: [Release] Basic Register Script
after u fill it and click on the register page is all white ...
Re: [Release] Basic Register Script
It does only check if an ip is banned. The Else is empty.
Posted via Mobile Device
---------- 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.
Posted via Mobile Device
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)
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.
Re: [Release] Basic Register Script
after completing all and click the register page is all white, nothing happens.
Re: [Release] Basic Register Script
Yep, not working, still get just a blank page with nothing inserted on DB.
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?
Re: [Release] Basic Register Script
Quote:
Originally Posted by
Liphe_xD
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
1 Attachment(s)
Re: [Release] Basic Register Script
I'm fix my problem and add future check user
Download Now...
Re: [Release] Basic Register Script
Re: [Release] Basic Register Script
Quote:
Originally Posted by
brumas
Yep, not working, still get just a blank page with nothing inserted on DB.
Use xampp 1.6.8 Download XAMPP from SourceForge.net
This will fix the blank page .
Re: [Web/PHP] Basic Register Script
This keeps giving me a white page with nothing inserted into database. :/
Re: [Web/PHP] Basic Register Script
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 http://85.14.242.138:82/register.php