[Web/PHP] Basic Register Script

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    All CHAOS! X_Sarah_X is offline
    MemberRank
    Jul 2009 Join Date
    BeachLocation
    630Posts

    [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
    {
    }
    ?>
    Attached Files Attached Files
    Last edited by X_Sarah_X; 14-03-11 at 01:35 AM.


  2. #2
    Creator of Code chreadie is offline
    MemberRank
    Mar 2006 Join Date
    SwedenLocation
    603Posts

    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?

  3. #3
    Member Liphe_xD is offline
    MemberRank
    Jun 2010 Join Date
    73Posts

    Re: [Release] Basic Register Script

    after u fill it and click on the register page is all white ...

  4. #4
    Creator of Code chreadie is offline
    MemberRank
    Mar 2006 Join Date
    SwedenLocation
    603Posts

    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

  5. #5
    Valued Member brumas is offline
    MemberRank
    Feb 2011 Join Date
    107Posts

    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)

  6. #6
    All CHAOS! X_Sarah_X is offline
    MemberRank
    Jul 2009 Join Date
    BeachLocation
    630Posts

    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.

  7. #7
    Member Liphe_xD is offline
    MemberRank
    Jun 2010 Join Date
    73Posts

    Re: [Release] Basic Register Script

    after completing all and click the register page is all white, nothing happens.

  8. #8
    Valued Member brumas is offline
    MemberRank
    Feb 2011 Join Date
    107Posts

    Re: [Release] Basic Register Script

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

  9. #9
    Member Liphe_xD is offline
    MemberRank
    Jun 2010 Join Date
    73Posts

    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 by Liphe_xD; 23-03-11 at 05:54 AM.

  10. #10
    Apprentice Kamikaze1 is offline
    MemberRank
    Mar 2011 Join Date
    22Posts

    Re: [Release] Basic Register Script

    Quote Originally Posted by Liphe_xD View Post
    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

  11. #11
    Enthusiast demonsoul is offline
    MemberRank
    Feb 2011 Join Date
    DeepinfernoLocation
    25Posts

    Re: [Release] Basic Register Script

    I'm fix my problem and add future check user

    Download Now...
    Attached Files Attached Files
    Last edited by demonsoul; 30-03-11 at 12:03 PM.

  12. #12
    Account Upgraded | Title Enabled! darkknight is offline
    MemberRank
    Mar 2004 Join Date
    チエンマイLocation
    269Posts

    Re: [Release] Basic Register Script

    Thank for release

  13. #13
    Apprentice Proxzor is offline
    MemberRank
    Feb 2008 Join Date
    8Posts

    Re: [Release] Basic Register Script

    Quote Originally Posted by brumas View Post
    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 .

  14. #14
    Apprentice Ccj911 is offline
    MemberRank
    May 2011 Join Date
    10Posts

    Re: [Web/PHP] Basic Register Script

    This keeps giving me a white page with nothing inserted into database. :/

  15. #15
    Apprentice racore90 is offline
    MemberRank
    Dec 2016 Join Date
    20Posts

    ! 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
    Last edited by racore90; 25-02-17 at 09:08 PM.



Page 1 of 2 12 LastLast

Advertisement