Results 1 to 3 of 3

Thread: Login Script that uses mysql

  1. #1
    Join Date
    Mar 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Login Script that uses mysql

    Hi,
    I'm looking for a FREE php script that uses mysql to make a login page. I would like one that has a create your account page. Right now I am using ezUserManager, but it does not work well.
    Thanks!
    Last edited by josh.legogeek; 03-25-2009 at 08:04 PM.

  2. #2
    Join Date
    Mar 2009
    Posts
    3
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    this php code will check a posted username and password in a users table on mysql. if you need a full script the message me

    PHP Code:
    <?php
    session_start
    ();
    if(isset(
    $_POST['login'])){
      if(!empty(
    $_POST['username']) && !empty($_POST['password'])){
        
    mysql_connect('host''user''pass');
        
    mysql_select_db('database');
        
    $q=mysql_query("select * from users where username = '".$_POST['username']."' and password = '".$_POST['password']."' limit 1") or die(mysql_error());
        if(
    mysql_num_rows($q) != '1'){
          die(
    'user not found');
        }else{
          
    $_SESSION['logged_in']='1';
          
    header("Location: /home.php");exit();
        }
    }

    session_write_close();

    ?>

  3. #3
    Join Date
    Mar 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile

    I might be able to work with that, but I found an xml one that works fine.
    Thanks anyways!

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
  •