Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by [oli] View Post
    wait :S is that the only bit of code inside register.php ?

    Wheres the whole php part that sends the username & password into a database.

    obviously it would say wrong username/password if the username & password don't get storred...
    Mmm i dunno Lol i just followed this http://forumnerds.com/showthread.php?t=5

  2. #12
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    Quote Originally Posted by :Kosmickitten View Post
    Mmm i dunno Lol i just followed this http://forumnerds.com/showthread.php?t=5
    This is suppoced to be your register.php :

    PHP Code:
    <?php
    require_once "dbconfig.php"// include the database information
    if(!isset($_POST['join'])){
    echo 
    "<form method=\"post\" action=\"register.php\">
    <label>Username</label><br/><input name=\"username\"/><br/>
    <label>Password</label><br/><input name=\"password\" type=\"password\"/><br/>
    <input type=\"submit\" name=\"join\" value=\"register\"/>
    </form>"
    ;
    }else{
    $pass sha1($_POST['password']);
    $user mysql_real_escape_string($_POST['username']);
    mysql_query("INSERT INTO users (id, username, password) VALUES (NULL, '$user', '$pass')") or die("somthing went wrong during the registration. MySQL said: ".mysql_error());
    echo 
    "registration compleate you may now <a href=\"loginform.html\">login</a>.";
    }
    ?>

  3. #13
    Join Date
    Apr 2006
    Posts
    1,463
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by [oli] View Post
    This is suppoced to be your register.php :

    PHP Code:
    <?php
    require_once "dbconfig.php"// include the database information
    if(!isset($_POST['join'])){
    echo 
    "<form method=\"post\" action=\"register.php\">
    <label>Username</label><br/><input name=\"username\"/><br/>
    <label>Password</label><br/><input name=\"password\" type=\"password\"/><br/>
    <input type=\"submit\" name=\"join\" value=\"register\"/>
    </form>"
    ;
    }else{
    $pass sha1($_POST['password']);
    $user mysql_real_escape_string($_POST['username']);
    mysql_query("INSERT INTO users (id, username, password) VALUES (NULL, '$user', '$pass')") or die("somthing went wrong during the registration. MySQL said: ".mysql_error());
    echo 
    "registration compleate you may now <a href=\"loginform.html\">login</a>.";
    }
    ?>
    That was my register.php
    Still makes no diffrence

  4. #14
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Make sure the database is actually receiving the login information (use the form, then check phpMyAdmin to see whether it inserted properly). If it did, that gives you a starting point.

  5. #15
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    You did set up your dbcongif.php did you ?

  6. #16
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by [oli] View Post
    You did set up your dbcongif.php did you ?
    If the file's included into the script, he'd be getting errors if it was stuffing up (wrong credentials, script not where it should be etc).

Page 2 of 2 FirstFirst 12

Posting Permissions

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