AnimeGalleries [dot] NetAnimeWallpapers [dot] ComAnimeLyrics [dot] ComAnimePedia [dot] ComAnimeGlobe [dot] Com


User Tag List

Closed Thread
Results 1 to 6 of 6

Thread: [Help - PHP] Error in code

  1. #1
    Senior Member Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion's Avatar
    Gil
    4,313.92
    Gender
    My Mood
    Devilish
    Gifts EVE Heart Fuuko Starfish
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    10-04-2012 10:56 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2008
    Location
    Somewhere down the road
    Threads
    44
    Posts
    825
    Blog Entries
    17
    Rep Power
    1063

    Thumbs up [Help - PHP] Error in code

    PHP Code:
               $username mysql_escape_string($_POST['username']);
                
    $password mysql_escape_string($_POST['password']);

         
    $query "SELECT * FROM users WHERE username = '" $username "' AND password = PASSWORD('" .$password "')";
            
    $result mysql_query($query) or die ("Error in query: $query. " mysql_error());
     
               if (
    mysql_num_rows($result) == 0) {
                echo 
    "ERROR: Incorrect username or password!";
            } else {
                    
    $_SESSION['auth'] = 1
                       
    session_start();            
                    
    setcookie("username"$usernametime()+(84600*30));
                    include(
    "memberMain.php");
                
    mysql_close();
                }
     
               
    mysql_free_result($result);
                
    mysql_close($connection); 
    hey guys..
    thanks if you bother..
    this is a snippet of the code i am creating for a project..
    and i don't understand why it always shows the "Incorrect username or password" even though what i am inputting are correct..

    i'll be grateful if you could point out where i am wrong..
    this is on mysql/php/xml/javascript/html/css rolled into one project..
    the last for the sem...
    Last edited by FlashD; 10-29-2009 at 02:04 PM. Reason: Changed tags

    ~Howl's Mistress Evil Twin from the Other Side here to save her from further humiliation...

    avenge me!..
    kill kill kill

    sig by .Elmer

  2. #2
    boopaloop! IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS's Avatar
    Gil
    25,635.11
    Gender
    My Mood
    Angelic
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    05-12-2012 02:03 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jan 2009
    Location
    I live in South Africa, Kempton Park, Birchliegh
    Age
    30
    Threads
    17
    Posts
    1,037
    Rep Power
    1172

    Default

    not sure myself just guessing here, but I think this could be the problem
    $query = "SELECT * FROM users WHERE username = '" . $username . "' AND password = PASSWORD('" .$password . "')";

    instead

    $query = "SELECT * FROM users WHERE username = '" . $username . "' AND password = '" .$password . "'";


    just wondering about this part PASSWORD('" .$password . "')";

    Millionaire Campaign:
    Making millionaires out of everyone


    This was unknowingly
    brought to you
    by .Elmer
    and knowingly
    sponsored by Baka Baka!!!



    avi made by my sweet cousin .Elmer


  3. #3
    Senior Member Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion's Avatar
    Gil
    4,313.92
    Gender
    My Mood
    Devilish
    Gifts EVE Heart Fuuko Starfish
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    10-04-2012 10:56 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2008
    Location
    Somewhere down the road
    Threads
    44
    Posts
    825
    Blog Entries
    17
    Rep Power
    1063

    Default

    tnx but it didn't work..
    anyway..
    i'll just have to check it over...

    ~Howl's Mistress Evil Twin from the Other Side here to save her from further humiliation...

    avenge me!..
    kill kill kill

    sig by .Elmer

  4. #4
    boopaloop! IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS has a reputation beyond repute IFS's Avatar
    Gil
    25,635.11
    Gender
    My Mood
    Angelic
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    05-12-2012 02:03 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jan 2009
    Location
    I live in South Africa, Kempton Park, Birchliegh
    Age
    30
    Threads
    17
    Posts
    1,037
    Rep Power
    1172

    Default

    also try switching the quotes around placing the double quote first and single quote second

    like

    "' . $username . '"

    instead of

    '" . $username . "'

    Millionaire Campaign:
    Making millionaires out of everyone


    This was unknowingly
    brought to you
    by .Elmer
    and knowingly
    sponsored by Baka Baka!!!



    avi made by my sweet cousin .Elmer


  5. #5
    Copyright 2013 FS FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD has a reputation beyond repute FlashD's Avatar
    Gil
    6,032.50
    Gender
    My Mood
    Lonely
    Gifts Ice Cream Bamboo Cup Notebook
    Mentioned
    211 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    08-15-2019 01:33 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2005
    Location
    I would like to know that too. O_o;;
    Age
    34
    Threads
    159
    Posts
    2,873
    Blog Entries
    5
    AW Wallpapers
    3
    Rep Power
    2196

    Default

    Try it this way :
    PHP Code:
    $query "SELECT * FROM users WHERE username = '" $username "' AND password = '" md5($password) . "'"

  6. #6
    Senior Member Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion has a reputation beyond repute Megamind's Minion's Avatar
    Gil
    4,313.92
    Gender
    My Mood
    Devilish
    Gifts EVE Heart Fuuko Starfish
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Latest Post
    10-04-2012 10:56 PM
    User Info Thanks / Tagging Info Gifts / Achievements / Awards vBActivity Stats
    Join Date
    Jun 2008
    Location
    Somewhere down the road
    Threads
    44
    Posts
    825
    Blog Entries
    17
    Rep Power
    1063

    Default

    tnx guyz...
    i appreciated your efforts..
    now, all i have to do is wait...

    ~Howl's Mistress Evil Twin from the Other Side here to save her from further humiliation...

    avenge me!..
    kill kill kill

    sig by .Elmer

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Code Lyoko videogame?
    By Alien Shadow Sesshomaru in forum Video Games
    Replies: 5
    Last Post: 11-30-2006, 08:49 PM
  2. anti ben 10 and code lyoko
    By night_inuyasha in forum General Anime & Manga
    Replies: 0
    Last Post: 05-08-2006, 06:51 PM
  3. The Bible Code
    By xCalypsox in forum Miscellaneous Miscellany
    Replies: 14
    Last Post: 03-26-2005, 05:29 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