Account Creation Page Help menu

User Tag List

Results 1 to 11 of 11
  1. #1
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Account Creation Page Help

    Hey, I am currently working on an account creation page for my private server, and i have run into a bit of a snag, the page isn't adding the information i want it to into my database, and i have spent a couple days trying to figure out why(did fix a couple other problems i would have had in the process) but am still unable to get it to insert the values into my database. Any help is greatly appreciated!
    Code:
    <?php
    $login=$_POST['login'];
    $password=$_POST['password'];
    $email=$_POST['email']; 
    $con = mysql_connect ("localhost", "user", "password") or die ('Error: ' . mysql_error());
    
    mysql_select_db ("logon", $con);
    $query = 'INSERT INTO Accounts (acct, login, password, encrypted_password, gm, banned, lastlogin, lastip, email, flags, forceLanguage, muted, banreason)
    VALUES (NULL, '".$login."', '".$password."', "", "0", "0", NULL, "", '".$email."', "24", "enUS", "0", "" )';
    mysql_query($query) or die ('Error Creating Account');
    mysql_close($con);
    header( "Location: " );
    ?>
    I exchanged localhost, user, password all for the correct values in my code and have no problem connecting. And have also tried echoing my query statement to make sure my variables were working correctly and they showed up as whatever i would type in the text box on my form page.
    P.S.
    Forgot to mention that the error i get whenever i try to create an account is the "Error Creating Account" message in the or die part after the query runs.
    Last edited by stoneharry; 10-23-2010 at 05:33 AM.

    Account Creation Page Help
  2. #2
    Thunderofnl's Avatar Elite User C# / Java / PHP Programmer
    Authenticator enabled
    Reputation
    491
    Join Date
    May 2008
    Posts
    1,033
    Thanks G/R
    20/20
    Trade Feedback
    6 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $login 
    $_POST['login'];
    $password $_POST['password'];
    $email $_POST['email']; 
    $con mysql_connect("localhost""user""password") or die ('Error: ' mysql_error());
    mysql_select_db("logon"$con);
    $query mysql_query('INSERT INTO Accounts (acct, login, password, encrypted_password, gm, banned, lastlogin, lastip, email, flags, forceLanguage, muted, banreason) VALUES (NULL, `$login`, `$password`, "", "0", "0", NULL, "", `$email`, "24", "enUS", "0", "" )');
    mysql_real_escape_string($query) or die ('Error Creating Account');
    mysql_close($con);
    header"Location: " );
    ?>
    Try now
    Last edited by Thunderofnl; 10-22-2010 at 06:58 PM.

  3. #3
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just tried that, i copy and pasted it and replaced what i had, then switched back in the values i took out and still getting the same thing "Error Creating Account"

  4. #4
    Thunderofnl's Avatar Elite User C# / Java / PHP Programmer
    Authenticator enabled
    Reputation
    491
    Join Date
    May 2008
    Posts
    1,033
    Thanks G/R
    20/20
    Trade Feedback
    6 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $login 
    $_POST['login'];
    $password $_POST['password'];
    $email $_POST['email']; 
    $con mysql_connect("localhost""user""password") or die ('Error: ' mysql_error());
    mysql_select_db("logon"$con);
    $query mysql_query('INSERT INTO Accounts (acct, login, password, encrypted_password, gm, banned, lastlogin, lastip, email, flags, forceLanguage, muted, banreason) VALUES ("", `$login`, `$password`, "", "0", "0", "", "", `$email`, "24", "enUS", "0", "" )');
    mysql_real_escape_string($query);
    mysql_close($con);
    header"Location: " );
    ?>
    Try again now

  5. #5
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no luck again. Still getting the "Error Creating Account" message. I even tried copying the original query that i had and running it directly in the database(using heidisql) to see if it was a problem with the query itself and it worked fine, well it put in the variables($login, $password, $email) into the values instead of what the user input would be on the page but thats cause it doesn't recognize those as variables in the Database(i think thats why, lol).

  6. #6
    Thunderofnl's Avatar Elite User C# / Java / PHP Programmer
    Authenticator enabled
    Reputation
    491
    Join Date
    May 2008
    Posts
    1,033
    Thanks G/R
    20/20
    Trade Feedback
    6 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe try to look at already made account creation scripts.
    Sorry can't help you I use Trinity.

  7. #7
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, yeah I've been looking around for some but haven't found any recent ones, anyway i really appreciate you at least trying to help me out this is getting frustrating, I've been looking around the web at different guides and stuff trying to get this problem fixed and no luck. Thanks again!

  8. #8
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, i have now changed my code around and am no longer getting the same error(yet..) Instead, if i submit all my information correctly i just get a blank page.
    And if, the password boxes don't match i get the "Please make sure your passwords match" message. Any help on whats wrong or how to fix it would be awesome, thanks.
    PHP Code:
    <?php
    if (isset($_POST['login']) && isset($_POST['password']) && isset($_POST['email'])) {
       
    // Connect

       
    $link mysql_connect('hostname''user''password');

       if(!
    is_resource($link)) {

           echo 
    "Failed to connect to the server\n";
           
    // ... log the error properly

       
    } else {
           
           
    // Reverse magic_quotes_gpc/magic_quotes_sybase effects on those vars if ON.

           
    if(get_magic_quotes_gpc()) {
               
    $login stripslashes($_POST['login']);
               
    $password stripslashes($_POST['password']);
               
    $email stripslashes($_POST['email']);
           } else {
               
    $login $_POST['login'];
               
    $password $_POST['password'];
               
    $email $_POST['email'];
           }
           
    // Make a safe query
           
    $query sprintf("INSERT INTO logon.accounts (`acct`, `login`, `password`, 'encrypted_password', 'gm', 'banned', 'lastlogin', 'lastip', 'email', 'flags', 'forceLanguage', 'muted', 'banreason') VALUES (%u, '%s', '%s', '%s', '%s', %u, %d, '%s', '%s', %u, '%s', %d, '%s')",
                       
    NULL,
                       
    mysql_real_escape_string($login$link),
                       
    mysql_real_escape_string($password$link),
                       
    '',
                       
    0,
                       
    0,
                       
    NULL,
                       
    '',
                       
    mysql_real_escape_string($email$link),
                       
    24,
                       
    enUS,
                       
    0,
                       
    '');    
           if(
    $password == $_POST['cpassword']) {           
                
    mysql_query($query$link);
           } else {
                echo 
    "Please make sure your passwords match\n";
           }

           if (
    mysql_affected_rows($link) > 0) {
               
    header"Location: connection info page" );
           }
           }
           } else {
               echo 
    "Error Creating Account\n";
           }

    ?>

  9. #9
    Druzil's Avatar Corporal
    Reputation
    6
    Join Date
    Oct 2010
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    if (mysql_affected_rows($link) > 0) {
               header( "Location: connection info page" );
    You'll have to change "Location: " to what you want the registration to forward to upon completion. For instance, if you want to go back to the index..

    Code:
    if (mysql_affected_rows($link) > 0) {
               header( "Location: index.php" );
    Just replace it with whatever file you want it to forward to.

  10. #10
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol, yeah i know I just took it out of the code when i pasted it it here, thats why i put in connection info page, cause thats what page it would go to, in my code it has the actual url. But my problem is still the same.

    It used to have an echo statement in there too, but i forgot i took that out, lol. Probably shoulda mentioned that.

    PS
    There is also nothing being added to the database from this, which leads me to believe that its not even getting to that part of the code, because if it did, it should have given me the Error Creating Account message. And also, if i typed in two mismatched passwords in the password/cpassword text box then i do get the Please make sure your passwords match message.
    Last edited by tranced; 10-24-2010 at 04:01 PM.

  11. #11
    tranced's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I finally fixed the problem, apparently for the column names, you can't use an apostrophe ' you have to use the key next to the 1 key(not sure what its called) but this one `

Similar Threads

  1. [Trinity] account creation page help
    By Ghostface133 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-21-2010, 06:33 PM
  2. Account Creation Page Help!
    By Abstraction in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 05-31-2009, 03:01 AM
  3. My servers Account Creation Page help?
    By chiefofu in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 03-16-2009, 05:25 PM
  4. Need help with account creation page!
    By Avaonix in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 11-21-2007, 02:23 PM
  5. [Help] Need Mangos Account Creation Page
    By hahaowned in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 10-10-2007, 12:36 PM
All times are GMT -5. The time now is 06:12 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search