Easy php signup form

Discussion in 'PHP' started by 0senjed0, May 24, 2009.

  1. #1
    i have create very simple sign up form and 90% of my codes are work fine but after users signup in form then can't login with username and password on login form . my sql save username and password fine in phpmyadmin at localhost too .

    my sql query : 
    
    create database mycontacts;
    
    use mycontacts;
    
    create table contacts(
    id int(11) auto_increment PRIMARY KEY,
    full_name varchar(200),
    password varchar(50),
    repassword text
    );
    
    Code (markup):
    please check my codes and fix it if you can
     

    Attached Files:

    0senjed0, May 24, 2009 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    can you post your code?
     
    bartolay13, May 24, 2009 IP
  3. felluahill

    felluahill Peon

    Messages:
    31
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Need to see the PHP code which is handling the login and registration in order to determine the problem.
     
    felluahill, May 24, 2009 IP
  4. tguillea

    tguillea Active Member

    Messages:
    229
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    90
    #4
    There is probably an error in connecting to the DB when you log in if it is being added when you sign up.
    After your query to check if the username / password are in the database, which probably looks something like:
    
    $result = mysql_query("SELECT * FROM members WHERE username='$username' AND password='$password'");
    
    PHP:
    add "or die(mysql_error());" so it looks like

    
    $result = mysql_query("SELECT * FROM members WHERE username='$username' AND password='$password'") or die(mysql_error());
    
    PHP:
    This way it will tell you if there is an error.

    Goodluck!
     
    tguillea, May 25, 2009 IP
  5. ‬‬‬‬‬‬‬‬

    ‬‬‬‬‬‬‬‬ Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    wow thanks for the info !!!, this is what I looking for...