SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    USA
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    interacting with vbulletin

    what method does vbulletin use to insert a password into the database, md5 or what??


    I want to have my login for my site interact with the forums, so if it is md5 it uses, how do i have the login form check the database with md5 to match passwords, thanks

  2. #2
    - Michael - Bytecon's Avatar
    Join Date
    Mar 2004
    Location
    Ireland
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I am pretty sure it uses MD5, simple, do the following:

    PHP Code:
    $password $_POST['password'];
    $username $_POST['usernae'];
    $newpass md5($password);

    $query "SELECT * from table WHERE username='$username' and password='$newpass'";
    $result mysql_query($query);
    $no mysql_num_rows($result);

    if(
    $no == "0"){
    // Login failed
    }else{
    // Login passed

    That is just the basic idea of how to do it, you would obviously want to strip the user input etc .. also, dont forget to change the table names and field names according and include the database connect.

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    USA
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks!

  4. #4
    - Michael - Bytecon's Avatar
    Join Date
    Mar 2004
    Location
    Ireland
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No problem, if you need more help / it doesn't work, give me a shout.


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
  •