[Help] Registration page for private server (Ascent) menu

User Tag List

Results 1 to 13 of 13
  1. #1
    mesoalt's Avatar Member
    Reputation
    2
    Join Date
    Jun 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Registration page for private server (Ascent)

    Hello everyone. I am in dire need to figure this problem out. I have my own domain name, Wofa.us, and i have a home page, connection info, forums, all these are working fine, but i need to know why my registration page is not working. Here are my codes for the register.php, register.html, and the error im getting.

    Register.php:

    <html>
    <body>
    <?php
    $pass1 = $_GET["pass"];
    $pass2 = $_GET["pass2"];
    $user = $_GET["user"];
    $connection = @mysql_connect("localhost", "root", "1234");
    if (!$connection)
    {
    die('Unable to connect to server: ' . mysql_error());
    }
    mysql_select_db("character",$connection);
    //Check the inputs arent blank
    if ($user == "" or $pass1 == "" or pass2 == "")
    {
    die('You did not complete all of the required fields');
    }
    //See if that user exists already
    $check = mysql_query("SELECT username FROM users WHERE username = '$user");
    if ($check2 != 0)
    {
    die('Sorry, the username '.$user.' is already in use.');
    }
    //password verification check
    if ($pass1 != $pass2)
    {
    die('Your passwords did not match. ');
    }
    //encrypt and add slashes
    $md5pass = md5($pass1);
    if (!get_magic_quotes_gpc())
    {
    $md5pass = addslashes($md5pass);
    $user = addslashes($user);
    }
    //add entry to sql database
    $insert = "INSERT INTO users (username, password)
    VALUES ('".$user."', '".$md5pass."')";
    $add_member = mysql_query($insert);

    echo "Congratulations, User: $user has been registered successfully";
    //mysql_close($connection);
    ?>

    </body>
    </html>

    Register.html:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Warriors of Flaming Anarchy</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    </head>
    <body>
    <div id="container">
    <div id="header">
    <img src="Banner.jpg" height="239px" width="930px" />
    </div>
    <div id="nav">
    <ul>
    <br /><br />
    <li><a href="index.html">Home</a></li>
    <br /><br />
    <li><a href="connect.html">Connection Info</a></li>
    <br /><br />
    <li><a href="register.html">Register</a></li>
    <br /><br />
    <li><a href="forums">Forums</a></li>
    <br /><br />
    <br /><br />
    <br /><br />
    </ul>
    </div>
    <div id="content">
    <h2>Create an account!</h2>
    <p>&nbsp;</p>
    <p>&nbsp;</p>

    <form action="register.php" method="get">
    <table border="0">
    <tr>
    <td>Username:</td>
    <td><input type="text" name="user" maxlength="12"></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type="password" name="pass" maxlength="10"></td>
    </tr>
    <tr>
    <td>Confirm Password:</td>
    <td><input type="password" name="pass2" maxlength="10"></td>
    </tr>
    <tr>
    <th colspan=2><input type="submit" name="submit" value="Register"></th>
    </tr>
    </table>
    </form>
    </div>
    </div>
    </body>
    </html>


    Error i get when i go to the link:


    Unable to connect to server: Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)


    Please do try to help me if you have any knowlage as to why this is happening. Give me a suggestion, etc and if you even attempt to actually help, and are not just lazy, saying something like you hav e the wrong coding or something, than i will for sure. Thanks everyone!

    [Help] Registration page for private server (Ascent)
  2. #2
    j9sjam3's Avatar Member
    Reputation
    14
    Join Date
    Mar 2007
    Posts
    190
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got Dreamweaver?
    I could cook you up something that is simular to this, in a few mins if you want.
    MD5 and making sure both fields the same would be up to you though ^^

    EDIT: try something like this...
    <?
    if($_POST['username'] == '') {
    ?>
    <table width="70%">
    <form action="index.php?action=newchar" method="post">
    <tr><td>Username:</td> <td><input type="text" name="username" maxlength="12"></td></tr>
    <tr><td>Password:</td> <td><input type="password" name="pass" maxlength="20"></td></tr>
    <tr><td>Password(Confirm):</td> <td><input type="password" name="pass2" maxlength="20"></td></tr>
    <tr><td><input type="submit"></td></tr>
    <tr><td><font color=red>Please Note: Only letters and numbers are allowed in both the username and password.</font></td></tr>
    </form>
    </table>
    <?
    } else {

    $_POST['username'] = strtolower($_POST['username']);
    $_POST['password'] = strtolower($_POST['password']);
    $_POST['password2'] = strtolower($_POST['password2']);
    if($_POST['pass'] == $_POST['pass2']) {
    $username = ucwords(ereg_replace("[^A-Za-z0-9]", " ", $_POST['username']));
    $password = ereg_replace("[^A-Za-z0-9]", " ", $_POST['pass']);

    // Make a MySQL Connection
    $query = "SELECT * FROM users WHERE username = '".$username."'";

    $result = mysql_query($query) or die(mysql_error());

    $userExists = false;
    while($row = mysql_fetch_array($result)){
    $userExists = true;
    }
    if($userExists == true) {
    echo '<b>Error</b>: That Username already exists. Please pick another.';
    } else {
    $sql = "INSERT INTO `wow`.`users` (
    `id` ,
    `username` ,
    `password` ,
    `banned` ,
    `tempbanned` ,
    `muted` ,
    `ban_by` ,
    `ban_reason` ,
    `ban_expire` ,
    `ban_level` ,
    `mgroup` ,
    `mgroup_others` ,
    `temp_ban` ,
    )
    VALUES (
    NULL , '".$username."', '".$password."', (other varibles would be here, cba to fill them in)
    );";

    mysql_query($sql);
    echo 'Congratulations, your account has been created! \'Server Ip\' is <font color=red>Server IP here</font>.<br>
    <b>Username:</b> '.$username.'<br>
    <b>Password:</b> '.$password.'';
    //echo 'Out Of Order';

    }
    } else {
    echo 'Sorry to bother, but the both of the password fields must be the same.';
    }
    }
    ?>
    Last edited by j9sjam3; 09-30-2008 at 02:18 PM.
    <--- please click.

    *working on a decent siggy*

  3. #3
    mesoalt's Avatar Member
    Reputation
    2
    Join Date
    Jun 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok this looks pritty good. thanks a ton! + rep oh btw, the server ip is the ip that im hosting the webserver, or the private server... like would it b 127.0.0.1? or like my ip address. (internal or external) once again Thanks

    Edit: i tried this code out... all looks Great! im getting an error when i submit:

    Not Found
    The requested URL /index.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.33 Server at wofa.us Port 80

    do i need to make a index.php? if so, i would greatly appreciate it if you wrote up a code for that.. plus rep tomarro too! Thanks a ton :]
    Last edited by mesoalt; 09-30-2008 at 06:54 PM.

  4. #4
    mesoalt's Avatar Member
    Reputation
    2
    Join Date
    Jun 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha, once again, im editing. ok, i set the index.php so that it goes to register.php and im getting this error:

    Warning: mysql_query(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/r/u/s/russellsite/html/wofa/register.php on line 26

    Warning: mysql_query(): A link to the server could not be established in /home/content/r/u/s/russellsite/html/wofa/register.php on line 26
    Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2)

  5. #5
    Flame_Warrior's Avatar Member
    Reputation
    36
    Join Date
    Sep 2008
    Posts
    182
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm... looks like you need to config your private server configs to your registration page, or visa versa.

  6. #6
    Maisteri's Avatar That spoiler guy
    Reputation
    441
    Join Date
    Aug 2007
    Posts
    894
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah and if its not running on your own computer (website) you need to change the localhost..

  7. #7
    Flame_Warrior's Avatar Member
    Reputation
    36
    Join Date
    Sep 2008
    Posts
    182
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think what he is saying, mamemu28, is that the private server is running on his computer, and the websites files are on his computer, but he isnt sure if that is considered running the website on his own computer... tel me if im wrong mesoalt :] anyway, im not sure, so anyone else want to give it a shot?

  8. #8
    volitle's Avatar Contributor
    Reputation
    181
    Join Date
    Nov 2007
    Posts
    1,127
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by mesoalt View Post
    ok this looks pritty good. thanks a ton! + rep oh btw, the server ip is the ip that im hosting the webserver, or the private server... like would it b 127.0.0.1? or like my ip address. (internal or external) once again Thanks

    Edit: i tried this code out... all looks Great! im getting an error when i submit:

    Not Found
    The requested URL /index.php was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/1.3.33 Server at wofa.us Port 80


    do i need to make a index.php? if so, i would greatly appreciate it if you wrote up a code for that.. plus rep tomarro too! Thanks a ton :]
    that would depend on where your db's are like if you where hosting the db then it would be your ip but if the website is on the hosting company or person then yes it would 127.0.0.1 and also double check password and usernames this is probably the error you getting if not come back to me and i will try something else for you


  9. #9
    mesoalt's Avatar Member
    Reputation
    2
    Join Date
    Jun 2007
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alright here is the deal. I do not use dyndns, or No-ip. My router has the ports 3306 and 81 forwarded. My php code is:

    <html>
    <body>
    <?php
    $pass1 = $_GET["pass"];
    $pass2 = $_GET["pass2"];
    $user = $_GET["user"];
    $connection = mysql_connect("127.0.0.1", "root", "root");
    if (!$connection)
    {
    die('Unable to connect to server: ' . mysql_error());
    }
    mysql_select_db("characters",$connection);
    //Check the inputs arent blank
    if ($user == "" or $pass1 == "" or pass2 == "")
    {
    die('You did not complete all of the required fields');
    }
    //See if that user exists already
    $check = mysql_query("SELECT username FROM users WHERE username = '$user");
    if ($check2 != 0)
    {
    die('Sorry, the username '.$user.' is already in use.');
    }
    //password verification check
    if ($pass1 != $pass2)
    {
    die('Your passwords did not match. ');
    }
    //encrypt and add slashes
    $md5pass = md5($pass1);
    if (!get_magic_quotes_gpc())
    {
    $md5pass = addslashes($md5pass);
    $user = addslashes($user);
    }
    //add entry to sql database
    $insert = "INSERT INTO users (username, password)
    VALUES ('".$user."', '".$md5pass."')";
    $add_member = mysql_query($insert);

    echo "Congratulations, User: $user has been registered successfully";
    //mysql_close($connection);
    ?>

    It will not work, why will it not work? wofa.us/register.

    PS dont just go to wofa.us. I am working on the laout, so looks sloppy. Please, someone tell me wtf im doing wrong. Much appreciated.

  10. #10
    j9sjam3's Avatar Member
    Reputation
    14
    Join Date
    Mar 2007
    Posts
    190
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You running it on Linux, yes?
    Try it on Windows.
    Download apache2triad (google it).
    Try it on there. Just keep everything to localhost, to see if it MySQL or whatever.
    <--- please click.

    *working on a decent siggy*

  11. #11
    freakyflow's Avatar Contributor
    Reputation
    116
    Join Date
    Jan 2008
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    actually here the link googling it doesn't come up first
    SourceForge.net: Apache2Triad

    Or on windows try wamp Install PHP 5 Apache MySQL on Windows : WampServer

    Or use a virtual machine like vmware and run wamp.


    This way you can easily test everything and learn at home, its much faster to develop with then move to an actual live server when your ready.

  12. #12
    j9sjam3's Avatar Member
    Reputation
    14
    Join Date
    Mar 2007
    Posts
    190
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <--- please click.

    *working on a decent siggy*

  13. #13
    Gamer's Avatar Active Member
    Reputation
    239
    Join Date
    Jan 2007
    Posts
    198
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or you can try xamp xD! I've used it before, pretty easy to setup.

    apache friends - xampp for windows

Similar Threads

  1. [Misc] Lookin for a teacher to help me create a Private Server.
    By Xantisan in forum WoW EMU Questions & Requests
    Replies: 9
    Last Post: 11-20-2010, 09:44 PM
  2. Registration Page for private servers
    By mesoalt in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 10-02-2008, 09:56 AM
  3. WoW account for private server
    By original~GANK~staz in forum World of Warcraft General
    Replies: 2
    Last Post: 05-23-2007, 04:12 PM
  4. Replies: 1
    Last Post: 04-16-2007, 05:10 PM
  5. Need some stuff for private server
    By xredzx01 in forum World of Warcraft General
    Replies: 2
    Last Post: 08-11-2006, 06:31 PM
All times are GMT -5. The time now is 08:55 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