Results 1 to 6 of 6

Thread: Register account and activation with email for a gameserver.

  1. #1
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Register account and activation with email for a gameserver.

    Dear community,


    Hello, just found this forum but i don't know if i'm posting in the right section about my problem first of all and second if you can help me. Well, We are building a website from begin with my Developer, for our online gameserver. We need a " Simple " javascript code for our website that can be connected with our database and people will be able to register an account for the game server. Accounts must be activated with email so the players will be able to change it if they want. All this must be " IN THE SITE ". The game name is " Lineage 2 " so if you know about it you can understand what i mean and what i need in the same time. We know this isn't so simple, but for a skilled guy maybe it's easy. You can see our website at the link below, also you can contact us.




    Regards,

    Site: www.l2euroworld.net

    Email: l2euroworld@hotmail.gr

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Javascript almost always runs in the browser, not on the server, so it is impossible to connect to a database with Javascript. However, what you're describing might be different; how does it work? Are you using Javascript in some unusual, innovative way?

    You can do this with normal Javascript, but through the help of another language (a server side language) like PHP, by using Javascript to send information to the server, then using PHP to do something on the server (such as communicate with the database). Or you could skip Javascript entirely and just reload the page to run the PHP.

    In order to answer your question in more detail, we'll need more specific technical information about how the website is configured and what options you have-- for example, do you have PHP available?


    Where you posted this is fine, although it might be better in the "PHP" or "Javascript" section, once we know exactly what is required. (A moderator can move it if needed.)
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I will give more informations about it as soon as possible.

  4. #4
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <?php
    session_start();
    if (isset($_SESSION['user'])) {
    header ("Location: member.php");
    }
    ?>
    <html>
    <!-- Script Has Been Created By Pauler From MxC 2011 -->
    <head>
    <title>
    Account Manager
    </title>
    <link type="text/css" rel="stylesheet" href="css/style.css">
    </head>
    <body>
    
    <div id='box'>
    <center>
    <b>
    <font size="6">
    Account Manager V2
    </font>
    </b>
    <br>
    <a href="login.php">Login</a> | <a href="register.php">Create An Account</a>
    <br><br>
    <form action="" method="POST">
    <table>
    <tr><td>Username:</td><td><input type="text" name="username" size="16"></td></tr>
    <tr><td>Password:</td><td><input type="password" name="password" size="16"></td></tr>
    <tr><td><input type="submit" name="submit" value="Register"></td></tr>
    </table>
    </form>
    <?php
    
    include ('connect.php');
    
    $username = $_POST['username'];
    $password = $_POST['password'];
    $submit = $_POST['submit'];
    
    if ($submit) {
    
    $check = mysql_num_rows(mysql_query("SELECT * FROM accounts WHERE login='".$username."'"));
    
    if ($check == 0) {
    
    $password = base64_encode( pack( "H*", sha1( utf8_encode( $password))));
    
    mysql_query("INSERT INTO accounts VALUES ('".$username."', '".$password."', '0', '0', '0', '1')");
    
    echo "<b>You have been registered. Visit the login page in order to login and edit your account.</b>";
    }
    else {
    echo "<b>This username already exists.</b>";
    }
    
    }
    ?>
    <br><br>
    <div id="footer">
    Developed By Pauler Account Manager Ver1.0 2011 MxC
    </div>
    
    
    
    </center>
    
    </div>
    
    </body>
    </html>
    It's something like this but as we tryed it. We are not that works.
    That's only for create an account. If you wanna see and for change password ask me to post it.
    Last edited by james438; 04-08-2013 at 04:57 AM. Reason: Huawei: I add something that i forgot;James438: added code tags

  5. #5
    Join Date
    Aug 2009
    Location
    charset utf-8
    Posts
    168
    Thanks
    4
    Thanked 5 Times in 5 Posts

    Default

    This should be moved over to the PhP section, but none the less I can help.
    These are the two articles you should read. I would post the code here, but I am not sure if the mods will like me posting a really long post that I copied

    Read this first-
    http://buildingbrowsergames.com/2008...tion-page-php/

    Then this is for the email confirmation-
    http://buildingbrowsergames.com/2008...on-system-php/

    Again, this has to deal with alot of Php, I highly recomend you reading up on it

    EDIT: Even though it says its for a browser game, the code should work for general use
    Last edited by FrickenTrevor; 04-08-2013 at 01:28 AM. Reason: format

  6. #6
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I will give a try, thanks.

Similar Threads

  1. Replies: 1
    Last Post: 01-06-2012, 05:14 AM
  2. Some hardass gameserver coding.
    By Anexxion in forum PHP
    Replies: 5
    Last Post: 09-16-2008, 12:19 PM
  3. PHP Email Activation Link
    By devil_vin in forum PHP
    Replies: 8
    Last Post: 08-28-2007, 12:38 PM
  4. Activation of account, simple question
    By toplisek in forum PHP
    Replies: 0
    Last Post: 12-05-2006, 09:16 AM
  5. Replies: 2
    Last Post: 11-10-2006, 05:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •